Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
0

Addind one unique script to 3 separate movie clips

New Here ,
Oct 21, 2013 Oct 21, 2013

Hi,

Where do you insert your script when your animation is composed of three separate movie clips? In a simple animation, I believe it would be on the first frame but in the case of threee movie  clips, I tried on scene 1, frame 1 but it didn't work, neither did it work on frame 1 of each animation. Is there a script (in scene 1 frame 1) that would include all three movie clips? My script is about replaying the animation every time a page of my digital brochure is reloaded.

Here is the sript I' m trying to apply:

function onPageOffView():void{

    this.stop();

}

function onPageViewed():void{

    gotoAndPlay(1);

}

Thank you!

Capture d’écran 2013-10-21 aĢ€ 14.30.20.pngCapture d’écran 2013-10-21 aĢ€ 14.29.35.png

TOPICS
ActionScript
459
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
LEGEND ,
Oct 21, 2013 Oct 21, 2013

That error in your first screen image is trying to tell you that you can't attach Actionscript directly to an object on the stage. You could do that with AS2 but not with AS3.

You could place the actionscript in its own layer in a keyframe. What event are you using to tell these functions onPageOffView() and onPageViewed()?

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
New Here ,
Oct 21, 2013 Oct 21, 2013

Thanks Rob.

I tried to place it, like you said, on a different layer in a keyframe but it didn't do much. It worked with another (very simple one) animation (please see pic). On frame 1, there is my script, on the last frame, there is a stop.

Also, I tried placing the actionscript on different layers (just like on the attached ex.) for each animation but, still, no results.Capture d’écran 2013-10-21 aĢ€ 16.46.36.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
LEGEND ,
Oct 21, 2013 Oct 21, 2013
LATEST

You have actionscript attached to frames 1 and 15. Do you have the same code in both frames? Is it the code that is in that actions window?

Do you have some action that is calling these functions? If you do, is it a frame event or a mouse event or something else?

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