all groups > flash actionscript > february 2004 >
You're in the

flash actionscript

group:

link from Button to URL


link from Button to URL hritikny
2/27/2004 8:56:39 PM
flash actionscript: Hi,
I would like to know the actionscrpts codes that we use to link button to an
URL that should pop up into a new window.

verify whether this is correct (it is not working)

something_btn.onPress-function(){

getURL(www.lycos.com, window, mehod);
}

//I am not sure what parameters I should use for window and method.

Kindly advise.

Hritik
Re: link from Button to URL sneakyimp
2/27/2004 10:13:09 PM
first, i think you need to use quotes around all the arguments for getURL

getURL("www.lycos.com", "_blank", "POST");

args for window:
_self (use the current browser window--will unload your flash movie)
_blank (will always create a new window...you can end up with a ton of open
windows if you're not careful)
anything else (will create a named window that you can later load other,
different things into)..you can call it "cart" or "mywindow" or whatever.

the problem with naming your window something like "cart" is that flash seems
to behave a bit oddly...if you are trying to populate a shopping cart, for
instance by doing something like this:

getURL("www.paypal.com?add=product67", "cart", "POST");

then your button will work the first time, but will not let you add any
additional product67 to your cart. it opens the window once and until you
close that window, the flash button in your original window won't work when you
press it again...not sure why. i guess because the URL is the same that flash
is somehow assuming that the URL is alread properly loaded. kinda sucks.


Re: link from Button to URL DannyYOYO
2/27/2004 10:13:32 PM
I have only recently started using flash...but i think i am right in saying
that....

For the button instance but in the code

on (release) {
getURL ("http://www.whatever.com);
}

You should then be able to use the target function (on the button) to put
in_blank to open the page in another window

Although i think a better way would be to create a function for the button. I
would get a second view as I am still learning!


Re: link from Button to URL hritikny
2/28/2004 2:46:40 AM
I am afraid it does not work. i have tried both in terms of a function and put the code into the button itself separately. Kindly advise

Re: link from Button to URL sneakyimp
2/28/2004 3:15:51 AM
Re: link from Button to URL (WORKS) hritikny
2/28/2004 3:41:17 AM
hey sneaky and Yoyo,

Thank you so much. IT WORKS. It was just a question of Browser. It works in Internet Explorer but NOT in SAFARI.
Best Regards,
Re: link from Button to URL nguyen162
3/31/2004 9:40:14 PM
Does anyone know a way to control the window size of a new window that's opened
from Flash? I tried

on (release) {
getURL('MM02T/toc.html','','width=640,height=500');
}

but that doesn't work. Any ideas?

Re: link from Button to URL sneakyimp
4/1/2004 2:30:55 AM
i think the only way for flash to control the window size (someone correct me
if i'm wrong here) is to use JAVASCRIPT....and getUrl('javascript:blah blah')
may or may not work. if you are calling a page whose content you can control,
you might want to add an onLoad routine that will size it properly. you might
also try looking up fscommand

but BE WARNED that flash and javascript don't always cooperate all that well.
Re: link from Button to URL Vorrel
4/9/2004 5:35:01 PM
Try this.

on(release){
getURL("javascript:void(window.open('Your URL .html','Name of what you are opening','height=230,width=340,toolbar=no,scrollbars=no'))");
Re: link from Button to URL nguyen162
4/20/2004 2:31:26 AM
AddThis Social Bookmark Button