Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

multiple movieclips and mutiple event handling.

Guest
Sep 02, 2013 Sep 02, 2013

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.

TOPICS
ActionScript
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Sep 02, 2013 Sep 02, 2013

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.rotati

...
Translate
Guru ,
Sep 02, 2013 Sep 02, 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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2013 Sep 02, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 02, 2013 Sep 02, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2013 Sep 02, 2013

Untitled.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 02, 2013 Sep 02, 2013

1.you should move all the code from the dirfferent layer to the first layer

2.Double click on your images movieclip and show another screenshot how it looks in there

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2013 Sep 02, 2013

Untitled2.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2013 Sep 02, 2013

This is the images movieclip with all images sequence in separate movieclips again.

In here, I gave the key, mouse and zoom events to keyframes sepaartely for each movieclips.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 02, 2013 Sep 02, 2013

1. move all the code you have in images to the root timeline, for debugging purposes that is important, you might have to adapt your code accordingly

2.show an image of any of your timeline animations that actually use sth. like

"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."

that I can get an impression how your whole app is structured

3.Make a Backup of your work in case sth. goe wrong, while migrating the code to root

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2013 Sep 02, 2013

Untitled3.png

This is one of the movieclip.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 02, 2013 Sep 02, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 03, 2013 Sep 03, 2013

Should I have to rearrange my code?

Please help.

As there r many movielcips how to control these events.????

Where should I add the following:

root.rotationframe  =  garage.currentFrame;

I not able to understand.

Please help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 04, 2013 Sep 04, 2013
LATEST

Thank you for all the help.

It was really really helpful..

Thank You again

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines