A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Should be simple :-(

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Posts
    9

    Should be simple :-(

    hi peeps,

    I'm having trouble with something that should be simple ( probably just me )

    in my scene I have 10 frames , each frame is stopped and runs a separate movie within each frame. the movie on frame 1 is called "movie1" and has 40 frames within it. On frame 10 on the main timeline ( root ) I have a button called "gohome" (in the instance name) that I would like ( once clicked ) to take the user to frame 20 within "movie1" movie on frame 1 ( I have labelled frame 20 "new" ).

    I thought the script should look something like this

    gohome.onRelease = function() {
    _root.movie1.gotoAndPlay("new");
    }

    but It won't do anything,

    If i do

    gohome.onRelease = function() {
    _root.gotoAndStop("start"); <--- btw "start" is frame 1's label
    }

    then it works, in as much as it plays "movie1", but...... i am trying to start the movie half way through on the users second time round.

    Please help it's driving me nuts.

    Thanks
    Last edited by tozstyle; 02-28-2008 at 10:11 AM.

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    If I'm understanding you correctly, you're trying to click a button on frame 10 and have it control "movie1", but movie1 isn't on frame 10, it's on frame 1. Correct?

    If that's right, something has to be on the stage at the time of the action in order to control it. Flash says "movie1? movie1 isn't here now." So, instead you'd want to go to the frame that movie1 is on and THEN tell it to do something. To do that, you'd do something like:

    Code:
    gohome.onRelease = function() {
    _root.gotoAndStop("start"); 
    replay=true;
    }
    Then on frame 1, you'd have something like:

    Code:
    var replay;
    
    if(replay==true){
    movie1.gotoAndPlay("new");
    }

  3. #3
    Junior Member
    Join Date
    Apr 2007
    Posts
    9

    Thankyou Thankyou Thankyou

    Thankyou Thankyou Thankyou Thankyou Thankyou Thankyou Thankyou

    GREAT !


    works perfectly - I will never forget this advise !

    THANKS


    Tozstyle

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