dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Very strange problem...

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    7
    I am stumped. Fairly new to Flash and actually have crashed along my learning here to put together a demo/tutorial for a new software product we built for medical. Coming along beautifully and have not had any real issues until now. Anyway to the point.

    I have the demo spread along 8 scenes (including Preloader and a Main Menu). As the scenes have become failry large in some cases - and some reading to do for the Doc to follow along as it is presented, I placed a set of control buttons to manage (I stop the play and present the buttons at various segments). Just did this the old fashion way...made the buttons and set the action. Also put in a mouseover label that describes the action of the button. OK, all was working fine - buttons working 100% through the the first two scenes (in fact I have used in over 70 instances in these two scenes). Now I come to the 3rd scence and for some reason my "Jump to Next Segment" does not work. Instead of going to the specified frame, it is always going back and starting the Scene from frame 1.

    Here is the script I am using for this part (cannot be much simplier)
    -----
    on (release) {
    gotoAndPlay(407);
    }
    -----

    So instead of going to frame 407 and playing, it starts the Scene over. Like I said, I have used these same buttons, and have copied code throughout the other 2 scenes over 70 times and works like a champ. But here, throughout this entire scene - anywhere I place these buttons, always starts from frame 1. Even made a simple test button and put in, same.

    Really am stumped here...any ideas????

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Are your buttons inside a movie clip? If so, you need to target the proper timeline. In this case, it's probably _root, which if you don't know, is the top level of a Flash movie.

    on (release) {
    _root.gotoAndPlay(407);
    }

    You also may try to label the frame you want to jump to (go to the frame, insert keyframe, in the properties dialog fill in the label)

    then you would say

    on (release) {
    gotoAndPlay("labelname");
    }

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I wouldn't call _root or _level0 the top level of a Flash movie, but rather the bottom level... But rdoyle720's diagnosis is probably right! You must be calling this from a button within a movie clip, and in that situation, you have to add _root (or _level0 from loaded movies on other levels), to target the main timeline.

    Furthermore, I would favor the labeled frame target as opposed the the frame number, because in this case that frame number has to be a cumulative number from the beginning of your movie (including the preloader's frames if you have one!), and is much more error prone than the labeled frame method. If you edit any scene previous to the targeted frame (shorten one for example...) while creating your movie, you'll have to re-calculate that cumulative number and correct all of your other goto's.
    A frame label allways remains attached (unless you delete it) to that particular frame, no matter how many edits you make in your scenes. Labels should be unique and of course set before you call them!

    So try...

    on (release) {
    _root.gotoAndPlay("labelname");
    }

  4. #4
    Junior Member
    Join Date
    May 2002
    Posts
    7
    Thanks for your replies. Actually not calling from a MC, believe it or not. Anyway, got the concept of calling via labels from another source and put in last night - something should have structured in the beginning and now working like a champ. Guess this is all part of the learning...

    Thanks again...

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