Posted on 2009-04-30
Last Modified: 2013-11-11
I am a newbie really, I spent half a day going through this tutoria to make ultra cool buttons.
Howevr the tutorial doesn't show how to get a button to change the url of the page,
in actionscript 3 you need something like this:

buttonSymbol.addEventListener(MouseEvent.CLICK, buttonSymbol_click);
function buttonSymbol_click(evt:MouseEvent):void {
    var req:URLRequest = new URLRequest("");
    navigateToURL(req, "_blank");

however because this guys tutorial creates a button wthin a movie clicp witin a movie clip, I can't seem to get this line to work:
buttonSymbol.addEventListener(MouseEvent.CLICK, buttonSymbol_click);
mainly because buttonSymbol seems to be inaccessible fromt the main timeline..

I have tried guessing for ages,and am now just fed up, doesnt CS3 have an object explorer? or a intelli sense that can help me find where the button actuall is????

help please.

Question by:RBertora
    LVL 5

    Expert Comment

    If your button is within a movieClip just reference the movieclip instance name first like so:


    If your button in nested deep in a movie which is in another movieclip reference the first mc, then the second then the button:

    LVL 8

    Accepted Solution

    AS3 doesn't really have an object explorer, but hang on to this bit of code, it will come in handy in the future. It will allow you to see all of your objects by name, show thier parent, and thier position in the display heirarchy.

    If you run it on the main timeline, then the "this" refers to the root (or stage) clip.

    var a:int;
    var s:DisplayObject;
          s = getChildAt(a);
          trace(, s.parent, s.parent.getChildIndex(s));

    LVL 7

    Author Closing Comment


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now