Groups | Blog | Home
all groups > flash actionscript > august 2007 >

flash actionscript : I need Help



Venom_man
8/29/2007 5:48:38 PM
Im kinda new to Flash and Actionscript also im using flash CS3. Right now im
working in an actionscript 2.0 document cause i found a nice pre loader
tutorial that uses actionscrpit 2.0. My problem is that im trying to turn a
button into a link to a web page, Im using this actioncrpit

hit.on (release){
getURL("http://www.odinfoam.com/modules.php?name=Products&file=kodiak",
"_blank");
}

i have given my button the instance name hit.

this is the error that i get
Expected a field name after '.' operator.
FlashForumName
8/29/2007 5:53:31 PM
Try this, assuming hit is the name of your button:


// code for main timeline
hit.onRelease = function()
{
getURL("http://www.odinfoam.com/modules.php?name=Products&file=kodiak",
"_blank");
}

// inside button itself on stage
on(click)
{
getURL("http://www.odinfoam.com/modules.php?name=Products&file=kodiak",
"_blank");
}
Venom_man
8/29/2007 6:00:45 PM
thank you the action script it self didn't work but i played around with it
and i jsut took the top part and it now seems to work

this is the part i took

hit.onRelease = function()
{
getURL("http://www.odinfoam.com/modules.php?name=Products&file=kodiak",
"_blank");
}
FlashForumName
8/29/2007 6:05:16 PM
Yep, there were 2 examples in there. I should've made that more clear. The
first one was for if you put the code on the timeline while the 2nd was for
inside the button instance itself if you wanted to use that route. Glad it
works.
AddThis Social Bookmark Button