A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How do I do getURL?

  1. #1
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    410

    How do I do getURL?

    I haven't really got into coding in AS3 at all yet and and still stuck in AS1!

    I need to write a quick function:

    myButton.onRelease = function()
    {
    getURL("start.html");
    }

    Simple?
    Erm... it doesn't compile - I get about 4 errors

    What am I doing wrong!?

    I haven't been lazy and have looked at the help files
    It's telling me to start off by using navigateToURL() instead

    BUT: all the examples relating to this function call ALL come with about 10 extra lines of code

    Am I missing something?? Do I *have* to have all that code JUST to make that same function call?

    I'd really appreciate if someone could get me started and tell me where I'm going wrong!

    Thanks


    OM

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You don't need that much code. The special-case onRelease property has been replaced by the general purpose addEventListener mechanism. getURL has been replaced by navigateToURL. That's about it.

    Code:
    myButton.addEventListener(MouseEvent.CLICK, clickButton);
    function clickButton(event:MouseEvent):void{
      navigateToURL(new URLRequest("start.html"));
    }

  3. #3
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    410
    thank u
    i'm going to start learning flash again properly soon!
    i'm really out of touch right now!

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