A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: button?

  1. #1
    Member
    Join Date
    Jan 2003
    Posts
    43

    button?

    help plz: the invisible button should force the mc to jump to frame 1.
    whats wrong?
    Attached Files Attached Files

  2. #2
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    First of all... Place the 'invisible' button on the timeline, you are not using it now, so it won't do much.
    You placed the movieclip crossfinal on the stage, but that only containes a shape, not the button. So I guess what you wanted to do is put the button inside the movieclip.
    Then I found this code hanging about on the movieclip and somewhere on a frame:
    Code:
    on (release) {
     gotoAndStop(1);
    }
    onRelease can only be used on a button, not on a frame or a movieclip. There are ways to simulate an onrelease function on a movieclip, but I guess that would be too complicated for you at this stage. So delete all the unnessecery code, drag the button inside the movieclip, select the button and then put this code on the button:
    Code:
    on (release) {
     _root.gotoAndStop(1);
    }
    You will need the _root. part because is targets the main scene. Since the button resides inside the movieclip and you would use the other code, you will target the timeline of the movieclip 'crossfinal' and we want to target the main timeline which is _root.

    Hope this helps, let me know if you can't make it work.

  3. #3
    Member
    Join Date
    Jan 2003
    Posts
    43
    success it worked at once. i was confused about the debugger told me that mouseevents are only possible at instances, so i put the code on "crossfinal". do i understand it right: _root means the action goes down to that path which route in this case to scene1?
    therefore other symbols i create are on higher levels?
    is there a possibility to view this tree structure while scripting?
    thought i see it b4, but i forgot where...
    thanx a lot, pal! user777

  4. #4
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    Glad it worked.

    You do have some kind of structure, but they aren't really levels. A flash movie can consist out of different levels. For example when you load an swf into your movie you can choose to load it into level0 or in a higher level. If you load into level1, the new movie will lay 'over' the current movie. If you load into level0 the new movie will replace the old one.

    So when you put a movieclip on your timeline this movieclip is still on level0 (or _root) but not on level1. You can target different movieclips by using the correct target path. You usualy start of with the _root. For example _root.myclip.myanimation targets a movieclip called animation that is in an movieclip called myclip that is on the main timeline.
    You can also target from within a movieclip by using _parent, _child or this. Check the tuts here on targetting to find a more elaborate explanation.
    is there a possibility to view this tree structure while scripting?
    That's a very good question actually. I suppose that might very well be possible, but I've never used it.

  5. #5
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    Okay, didn't take me that long...
    Choosing > window > Movie Explorer will do the trick!

  6. #6
    Member
    Join Date
    Jan 2003
    Posts
    43
    actually mc "move" will look like a filmstrip with some pics in it and will serve as the menue. it should behave in a way that when a certain pic pass through the invisible button and the user rollover it, then the pic should stop at the button`s position. on press another scene will open, on rollout the mc carry on moving.
    is that if/else coding?
    user777

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