A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: dynmic navigation help

Threaded View

  1. #4
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425
    in that case, define clicked on your root timeline and refer to it in your movieclips' code as:

    MovieClip(root).clicked

    then any button that is clicked will set the variable and no further animation calls will take place.


    and yes, generally you'd find it better to assign all of these listeners and functions from the main timeline, and you could employ a for loop to iterate through all of your buttons and add the listeners, and define your handler functions once, so you don't have to redundantly include virtually the same exact code 12 times.


    Something like this:

    PHP Code:

    for (var i:Number 1i<=12i++)
        {    
        
    this["button"+i]["planet"+i+"_btn_mc"].addEventListener(MouseEvent.ROLL_OVERplayMoviefalse0true);
        
    this["button"+i]["planet"+i+"_btn_mc"].addEventListener(MouseEvent.ROLL_OUTstopMoviefalse0true);
        
    this["button"+i]["planet"+i+"_btn_mc"].addEventListener(MouseEvent.MOUSE_DOWNonDownfalse0true);
        
    this["button"+i]["planet"+i+"_btn_mc"].addEventListener(MouseEvent.MOUSE_UPonUpfalse0true);
        }

    function 
    playMovie(e:MouseEvent):void
    {
    e.target.play();
    }

    function 
    stopMovie(e:MouseEvent):void
    {
    e.target.stop();
    }

    function 
    onDown(e:MouseEvent):void
    {
    e.target.planet_btn_clicked_mc.alpha =.4;
    }

    function 
    onUp(e:MouseEvent):void
    {
    e.target.planet_btn_clicked_mc.alpha =0;
    MovieClip(root).gotoAndPlay("btn_click_anim","Scene 1"); 

    Last edited by scottPadgett; 03-12-2009 at 01:11 AM.
    :: scott ::

Tags for this Thread

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