A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: On Release Get URL

  1. #1
    Junior Member
    Join Date
    Sep 2008
    Posts
    7

    On Release Get URL

    Hi all,

    1.) I have the following exact code for a button in a keyframe on the timeline (not in the button itself and of course excluding the quotes)

    "
    on (release) {
    getURL ("www.yoursite.com", "_blank");
    }

    "

    and I get the following error when I try and preview in Flash CS3

    1087: Syntax error: extra characters found after end of program.

    2.) Also, I have another layer with a "stop" action taking place at the same time that this button occurrs, however, once I have the script in the keyframe for the button, it seems to override the stop action. So, basicly, IM looking to stop the movie and get this button to, once clicked, open a web address.

    Thanks all!

  2. #2
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    your frame script should look something like this:

    Code:
    your_button.onRelease=function() {
    getURL("www.yoursite.com", "_blank");
    }

  3. #3
    Junior Member
    Join Date
    Sep 2008
    Posts
    7
    Hello:

    I have added the script above. I replaced "your_button" with the name of my button which is "Learn_More"

    Now I get two errors:

    "1120: Access of undefined property Learn_More."
    "1180: Call to a possibly undefined method getURL."

    I am using Acxtion Script 1and2 in CS3.

    Thanks!

  4. #4
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    Make sure you are publishing it in Flash Player 8 and NOT 9

  5. #5
    Junior Member
    Join Date
    Sep 2008
    Posts
    7
    ok this resolved the error problem. Thanks! However, my buttons rollover functions work (on mouse over) but once I click the button, it doesnt open up the new "blank" window in the default browser. Any suggestions on this?

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    changes in Flash Player security makes getURL fail when testing offline
    you must upload to your server and test online

  7. #7
    Junior Member
    Join Date
    Sep 2008
    Posts
    7
    We posted it to the server, and this didnt affect anything. There is another problem, possibly in the action script of the movie.

    Im simply trying to make a button that opens a new HTML window....I wouldnt think that this should be that hard. ??? Thoughts?

    Current code as provided from last forum poster:

    Learn_More.onRelease=function() {
    getURL("http://www.identitystudios.biz/apsweb/prospectpro.html", "_blank");
    }

    Using Flash CS3

  8. #8
    Junior Member
    Join Date
    Sep 2008
    Posts
    7
    Guys any thoughts? Im still very stuck on this

  9. #9
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    as long as you are NOT publishing it in Flash Player 9, it has to work.. there is absolutely nothing wrong with the code you have now..
    May be there is some bug with your button symbol, delete it and create a fresh button symbol.

  10. #10
    Senior Member
    Join Date
    Sep 2007
    Location
    UK
    Posts
    194
    Just to clarify, this code
    PHP Code:
    Learn_More.onRelease=function() {
    getURL("http://www.identitystudios.biz/apsweb/prospectpro.html""_blank");

    is placed on the timeline where the button is visible right, and the button/movieClip has the instance name of Learn_More ?

  11. #11
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    if you have the above correct and have uploaded the swf and html
    to your server, you should have the same interaction as this link -

    http://www.jackleaman.co.uk/temp/apsweb.html

  12. #12
    Junior Member
    Join Date
    Sep 2008
    Posts
    7
    Ahhh...thanks to your help I saw what I did wrong. I hadnt put a label for the instance...and it appears (correct me if Im wrong) that the script calls an instance of a button named "More_Info". Its the instance its looking for, not the name of the button. Once I put the name for the instance (same as the button name) then published, it worked great Thanks again!

  13. #13
    Junior Member
    Join Date
    Dec 2008
    Location
    New York
    Posts
    1

    same problem

    hello, first post here..

    I'm having a similar problem. I'm very new to flash and I'm learning as I go. i'm trying to add some flash to my website at the moment.

    I typed some simple text and now i want to link it to another page (i'm using Actionscript 2.0 but flash cs4 since actionscript 3.0 is too confusing)

    I use the following script originally: getURL("http://magdalenaphoto.com/humble.html"); but it automatically goes to that website, does not wait for me to click on the link.

    So i tried the code that was in this thread

    humble.onRelease=function() {
    getURL("http://magdalenaphoto/humble.html");}


    but it does nothing. it's just simple text and no link.


    Do i need to add a blank keyframe anywhere?

    I added a keyframe to UP, Over, Down but left Hit alone.

    Any help would be greatly appreciated...

  14. #14
    Junior Member
    Join Date
    Feb 2009
    Posts
    1

    Button stop

    Hi Guys, I have similar issue as cgrimes under point 2 of his post:

    I have a button with similar script as his in the button layer. main layers stop (done that by stop(); in the last keyframe in a layer under the button layer) after appearing to create the background and other movieclips loop. However the stop frame in the main timeline makes this button inactive when it reaches the stop frame (the button has to be the first layer in timeline; webhost requirements:/).

    could you help me to make it work so that the movie will stop however the button will remain active infinitive while the movieclips loop?

    there is probably easy solution however I'm struggling to accomplish this and I suspect it's due to I'm an AS noob therefore any help would be appreciated!

  15. #15
    Member
    Join Date
    Feb 2006
    Location
    Johannesburg, South Africa
    Posts
    41
    magdalenaphoto. I suspect that your problem is that you are attaching the Actionscript incorrectly. If you are a beginner and you have created a btn then attach this code onto your btn instance not on the frame.

    PHP Code:
    on(release){
    getURL("http://magdalenaphoto/humble.html","_blank");

    Always add a hit state to a btn otherwise you will struggle especially when the using text. The hit state should be a solid colour that is drawn over the area that you would like to be interactive with the mouse pointer. By leaving it blank is whats causing your problem.

    By not putting your getURL("http://magdalenaphoto.com/humble.html"); into a function your are telling flash to run it when that frame is loaded. Thats what is causing your the trouble.

    stop() on frames actions should not affect your btns. A function is called when in your example you release the btn.

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