all groups > flash actionscript > january 2005 >
You're in the

flash actionscript

group:

Creating Electric Flow In A Wiring Schematic


Creating Electric Flow In A Wiring Schematic aebruce
1/23/2005 10:51:39 PM
flash actionscript:
I am new to Flash and Actionscript. I am trying to create an electrical
schematic which shows electricity flowing through the wires when certain
buttons are clicked. The electrical wires can have different voltages (24VDC,
28VDC, 26VAC, 115VAC, or no electric flow) flowing through the wires, and
sometimes the elcetric flow will be in the opposite direction. I created a New
Symbol, MovieClip, and made 9 different frame events along the timeline. The
first frame is no electric flow (black), frame 2-5 is two small balls (1-red,
1-white) that create motion in one direction, frames 6-9 is two small balls
(1-white, 1-red) that create motion in the opposite direction, and so forth.
When I drag the MovieClip from the Library I want to link them together, like a
chain, to make the length of wire I need for each circuit segment. With
Actionscript, I then want to 'gotoAndPlay' the specific segment in the
MovieClip based on different buttons clicked. When I place the Library
MovieClips on the screen I give the same 'Instance Names' to all Movieclips
that pertain to a certain wire segment. I use a different 'Instance Name' for
other wire segments that will act differently, based on the button clicked. My
problem is that only one Movieclip (2 balls) play along the wire segment where
I have given all the Movieclips the same 'Instance Name'. Thanks for any help.
Bruce...
Re: Creating Electric Flow In A Wiring Schematic rlc5611
1/24/2005 3:14:00 AM
You need to rethink your plan. You should not give several movie clips the same
instance name because you can only target one of them. You can place several
movie clips that are common into a single movie clip. Will the diagram
construction be something you a user will create dynamically during runtime or
is this just a library you are putting togther for your own use during
authoring? Either way, if I had multiple movie clips with red dots moving one
way or the other, I would make the dots into movie clips also and use a hitTest
so that when the dot got to the end of its segment, it would trigger the dot in
the next segment to start moving and so on and so on such that the motion
looked continuous. You should think very hard about the '9 frame' concept and
make certain it is really the correct way to begin the project because once you
start, if you change your mind later, that will be the hardest thing to back
out of. Another idea would be to keep each state of motion as a movie clip
within the segment (one frame) movie clip with all three of the movie clips
(you would actually only need two) being normally invisible and only being made
visible as the corresponding button was pressed. These would be a lot easier to
modify after-the-fact, for example. What you are planning sounds great and
Flash can do it. I have worked on projects of similar scope and having a good
plan up front will save you a ton of work later on. Play with different ideas
until you get what you want before you get too far along. Probably someone here
has done the same or similar and can give some good advice.
Re: Creating Electric Flow In A Wiring Schematic aebruce
1/24/2005 1:33:52 PM
AddThis Social Bookmark Button