Log in

View Full Version : Need help creating a linked button in flash



tssandoval
03-30-2008, 08:27 PM
I have created a button in Flash CS3 Proffessional, the button works fine but I keep getting errors when I try to add the getURL, I cannot find the appropriate place to have flash link to the getURL so I have been typing in the actions panel the following...

instance_cross.onRelease = function() {
getURL("http://www.ednadesigns.com/crosses.htm");
}

I also tried in the fisrt layer, first frame

on(release) {
getURL("site.com");
}

I think I am just not puttin it in the right place, or using the wrong language for Flash CS3

Anyway any help would be greatly appreciated, I cant believe it is so difficult to link a button in Flash, but I guess once I know how it wont be ....thanks and happy sunday to all. Traci

Medyman
03-31-2008, 01:54 PM
Hi Traci..

That is the right code if you're using ActionScript 2.0.

Flash CS3 has the capability of compiling in both AS 2.0 and AS 3.0.

Make sure that you're in an AS 2.0 project and within the publish settings, make sure you're publishing to Flash 8 or lower.

tssandoval
03-31-2008, 02:28 PM
i received and error saying...
scene 1, layer 1, frame 1, line 1
mouse events are permitted only for button instances

perhaps I have put the action scrpt in the wrong place? thank you so much for your help. Traci

Medyman
04-03-2008, 03:04 PM
Ahh, I just reread your first post. I see what you're doing.

The following should go in the actions panel on whatever frame that the button. Again, on the timeline not on the actual movieclip.


instance_cross.onRelease = function() {
getURL("http://www.ednadesigns.com/crosses.htm");
}


If you want to add the action on the actual movieclip, click on the movieclip then open the actions panel and add this:


on(release) {
getURL("site.com");
}

I don't recommend the second way because it gets really difficult to troubleshoot should something not work. If all AS is one place, it makes it easier. BOTH will work though and do the same thing