dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Movie Clip trigger

  1. #1
    noob in training
    Join Date
    May 2009
    Location
    Malaysia
    Posts
    23

    Movie Clip trigger

    Hi there, i'm Sum and i'm more of a flash animator... I just started As 3.0 recently. What should i script in the last frame on a mc so that it would change a variable and trigger another mc on the stage to play?

    error 1122 showed up when i tried to script it the AS 2.0 way.

    Thank you very much.

  2. #2
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Not seeing any code, I would just suggest trying something like
    PHP Code:
    //last frame, give the variable a new value.
    variable_name = new value
    Then just add a conditional statement that if the variable == the new value, to play another mc on the stage.
    Wile E. Coyote - "Clear as mud?"

  3. #3
    noob in training
    Join Date
    May 2009
    Location
    Malaysia
    Posts
    23
    Quote Originally Posted by Robb@exo View Post
    Not seeing any code, I would just suggest trying something like
    Then just add a conditional statement that if the variable == the new value, to play another mc on the stage.
    didn't quite worked... i have this on the last frame of my MC

    "mc_null.gotoAndPlay (pagenumber)"

  4. #4
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    What did you use for the conditional statement?
    Wile E. Coyote - "Clear as mud?"

  5. #5
    noob in training
    Join Date
    May 2009
    Location
    Malaysia
    Posts
    23
    this is my first try:
    function playSomething(e:Event){
    if (trigger_01.currentFrame.name == "done"){
    triggered.gotoAndPlay(2);
    }
    }

    2nd try:

    trigger_01.addEventListener(Event.ENTER_FRAME, triggerEvent);
    function triggerEvent(e:Event):Void{
    if(e.target.currentframe == "done"){
    triggered.play();
    }
    }
    Last edited by ashed-dreams; 06-05-2009 at 01:34 PM.

  6. #6
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Try uploading your file... looking at bits and pieces makes for a more difficult diagnosis.
    Wile E. Coyote - "Clear as mud?"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center