Flash scripting question
- Started
- Last post
- 12 Responses
- CygnusZero4
I need to have a button in Flash open a webpage in a new window. Searching around but can't find how to do it.
on (release) {getURL();
}
- byDefault000
on(release){
getURL("http://www.webaddressher...
}- wtf - why didnt that work ha
byDefault00 - lol i dont knowCygnusZero4
- wtf - why didnt that work ha
- byDefault000
getURL("http://www..com","_blank...
- chrisRG0
on( release )
{
getURL("url", "_blank");
}
- opentran0
getURL("http://www.site.com", "_blank");
- CygnusZero40
Sweet thanks.
- byDefault000
wait you work for KPMG? nyc?
- Montvale. Do lots of 3D, AfterEffects and Flash here. Not a scripting wiz though.CygnusZero4
- Montvale NJ.CygnusZero4
- hm interesting - wouldn't think that a financial firm would do that king of work.byDefault00
- Yeah we even do a lot of blu ray stuff. We have a multimedia department here. 2 of us do 3D, AE and Flash, and the other 3 do all video.CygnusZero4
- ...and the other 3 do video work.CygnusZero4
- byDefault000
wait you work for KPMG? nyc?
- anxiousarms0
keep it off the button. put the code on the timeline like you're supposed to. give the button an instance name and code it like this:
yourButton.onRelease = function
{
getURL("your url here");
}coding on buttons and mc's is antiquated.
- I'm not really a scripting guy. Designer and animator, mostly 3D and AE though, so you're losing me here.CygnusZero4
- good point - though i figured if he were asking to begin with this would be a bit much to comprehendbyDefault00
- Yeah I'm a good animator in Flash, but not a great scripter at all. I need to get better at it.CygnusZero4
- right, but why give him bad code advise instead of just telling him how to do it right the first time?anxiousarms
- anxiousarms0
oops:
yourButton.onRelease = function ()
{
getURL("your url here");
};
- CygnusZero40
Let me ask this. What if I want to tell the window to open at a specific size? Is that possible in Flash?
- anxiousarms0
sorta' you'd have to write the resize funciton and url detail in javascript on the html page and then call to the javascript from the flash.
for a more informed answer and maybe help with the code ask the dudes on http://www.gotoandlearnforum.com…
- anxiousarms0
and about the code above being too complex...
it's basicially the same thing as you were doing before with different sytax.
just copy/paste it and change the instance name (yourButton) to whatever you want it to be, then change the URL and viola.
if you want a blank window add this:
getURL("URL", "_blank");