Skip to main content
September 2, 2013
Answered

multiple movieclips and mutiple event handling.

  • September 2, 2013
  • 1 reply
  • 1685 views

Hi All,

I have multiple movieclips(images sequence), which I want to add mouseevent (click and drag), keyboard event(left and right arrows) and zoom event(mouse wheel).

I have this function for only one mc(one image sequence).

Now if I use this function, I am having problem with calling the function from the same frame.

That is,

If click another mc from say frame 3, and click on another function, it should continue from frame 3 only, not start from first frame again.


Please help.

Thanks in advance.

This topic has been closed for replies.
Correct answer moccamaximum

This is one of the movieclip.


I assume that shows the part where you rotete the house view in a 360degree fashion?

if so, make a global var on your root timeline:

var rotationframe:int = 1; //in the beginning of the app all the dirffernt images are sitting on frame 1

you can access this var from anywehere inside any function of your app by calling:

root.rotationframe

now in the function that handles the rotation (lets say its your keyboard function) in the end (after you moved the playhead) you make sure to always set

root.rotationframe  =  garage.currentFrame;

and in the function that handles the switching between images you write sth. like

gotoAndStop(root.rotationframe);

Be aware, you can`t simply use that code without adapting it to your special needs.

1 reply

Inspiring
September 2, 2013

when you click on a MovieClip, you can store its currentFrame so:

var cF:int = e.target.currentFrame;

then in the function you us e to navigate to the next MovieClip use:

e.target.gotoAndPlay(cF);

September 2, 2013

Hi,

I have completed my script for mouse click and drag, zoom event and keyboard event using Adobe Forum (Hope u remember)

The same thing, I want to use multiple mcs with image sequences of same number of frames.

So, wen I click on one function, it is to navigate through these events and wen I call anthr function, it has to continue from same frame not jump to first frame again.

Thank u in advance.

Please help.

Inspiring
September 2, 2013

Show a screenshot of the timeline (stage) inside flash (use the advanced editor of this forum to post pictures)