A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [F8] variable.gotoAndStop()

Threaded View

  1. #1
    Member
    Join Date
    Nov 2007
    Posts
    83

    [F8] variable.gotoAndStop()

    I have one button on _root and an invisible movieClip on _root. I would like to have button goto another movie clip's second frame when the movieClip's _y is changed. Heres the button's code:

    PHP Code:
    on (press) {
        
    _root.starting "yes";
        if (
    _root.starting == "yes") {
            var 
    new_empty_mc:MovieClip this.createEmptyMovieClip("empty_mc" _root.number_root.number);
            
    _root.new_empty_mc._x 35.8;
            
    _root.new_empty_mc._y 12;
            
    _root.new_empty_mc.attachMovie("uc_id""uc_mc"1);
            
    _root.selectedNote "empty_mc" _root.number ".uc_mc";
            
    trace("_root.selectedNote = " _root.selectedNote);
            
    startDrag(new_empty_mc,true);
            
    _root.number _root.number 1;
        }


    And here's the invisible movie's code:

    PHP Code:
    onClipEvent (enterFrame) {
        if (
    _root.empty_mc1._y >= 50) {
            
    _root.selectedNote.gotoAndStop(1);
        }
        else if (
    _root.empty_mc1._y <= 50) {
            
    _root.selectedNote.gotoAndStop (2);
        }


    It doesn't go to the second frame. Can anyone help me?


    *edit: added tags
    gparis
    Last edited by gparis; 11-08-2007 at 05:49 PM.

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