PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Button - Open URL on Click
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Button - Open URL on Click

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

    Button - Open URL on Click

    Adobe Flash CS4 - ActionScript 2

    Right now I have a button with a Up and Over frame. I already found a way to do this task but it gave me some problems so I want to find a more elegant way:

    I double clicked my button and clicked on either frame and added this code:

    Code:
    on (release){ getURL("javascript:LightboxDelegate('imgs/Lizart_1_x768.jpg','Scape oil 60x76cm / 24x30 inch')"); }
    but it does not work. Where do I have to put this code in order to work?

    Thanks.

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    If you are using a Flash button, you driving a little too deep. Return to the main page that contains the button and SINGLE CLICK the button. This will highlight it, but not go within it. Your actionscript panel should now be active. The code you have above, will simple be place at that level and you should be off an running.

    All the code related to this button will appear in this same area.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    It is still not working. Any way I can place a line to debug?

  4. #4
    Member
    Join Date
    Sep 2009
    Posts
    57
    Actionscript Code:
    //Classic Button
    on (press) {
        getURL("javascript:LightboxDelegate('imgs/Lizart_1_x768.jpg','Scape oil 60x76cm / 24x30 inch')");
    }
    //Use a MovieClip instead
    //DO NOT PLACE THIS CODE IN A BUTTON IT MUST GO ON A FRAME
    button.onPress = function()
    {
        getURL("javascript:LightboxDelegate('imgs/Lizart_1_x768.jpg','Scape oil 60x76cm / 24x30 inch')");
    };
    Sometimes it is better to use onPress functions rather than a classic button. I had a similar problem and by doing this I managed to fix it.

  5. #5
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    "Press" did it! Thanks a lot

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