A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] attach code to a loaded button

  1. #1
    Junior Member
    Join Date
    May 2006
    Posts
    19

    [F8] attach code to a loaded button

    Code:
    this.createEmptyMovieClip("flag1holder", this.getNextHighestDepth());
    flag1holder.createEmptyMovieClip("flag1container",flag1holder.getNextHighestDepth());
    flag1holder.flag1container.attachMovie("BUTTflag1", "new_name", flag1holder.flag1container.getNextHighestDepth());
    flag1holder.flag1container._x=271.1;
    flag1holder.flag1container._y=152.9;
    BUTTflag1.onRelease=function(){
    	loadlang1.trigger();
    	gotoAndPlay(23);
    }
    }
    i want my loaded button (BUTTflag1) to trigger an xml connector and then gotoAndPlay(23)

    is this the right place to put this code?

    you guys are being really generous with your time today, i really appreciate it.

    thanks!
    James

  2. #2
    Senior Member
    Join Date
    Nov 2005
    Location
    Milan
    Posts
    119
    You need to attach the code to the instance name of the symbol, not the linkage name:


    flag1holder.flag1container.new_name.onRelease=func tion(){
    loadlang1.trigger();
    gotoAndPlay(23);
    }

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