A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] button inside a movieclip

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    3

    resolved [RESOLVED] button inside a movieclip

    I'm adding a MovieClip with with the following code in the main timeline:


    var mcCiclo_01:mc_ciclo=new mc_ciclo;

    function ciclo(event:MouseEvent):void{
    addChild(mcCiclo_01);
    }


    I want to use a button inside that movieclip to link to an external web page. I was able to do that with dot notation if the movieclip was "fisically" in the main timeline but this way doesn't work.

    I reckon this is the best practice. Any ideas would be appreciated.

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    PHP Code:
    mcCiclo_01.getChildByName('btn').addEventListener(MouseEvent.CLICKonClick); 
    Please use [php] or [code] tags, and mark your threads resolved 8)

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    3
    That's it! Thanks a lot neznein9!

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