PDA

View Full Version : Going to URL after clicking frame



ptancred
10-16-2006, 05:58 PM
Hi.

Im just starting with Flash, and would like to have it so that if the user clicks on a certain frame, then its bring them to another website. I presume this can be done in ActionScript. If it can, can someone please tell me how.

Thanks.

SaishuHane
10-16-2006, 07:46 PM
depending on when you want that action to kick in, heres two ways of going about it that i know of


on (release) {
getURL("http://s10.invisionfree.com/Jahs_vision_of_Love/index.php?act=idx",diff);
}

or


on (press) {
getURL("http://s10.invisionfree.com/Jahs_vision_of_Love/index.php?act=idx",diff);
}

the difference between them is the first code waits until the user releases the left mouse button and the 2nd one waits until theres any click at all

ptancred
10-16-2006, 08:58 PM
Thanks for replying. When I try to export the movie, I get this:


**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Mouse events are permitted only for button instances
on (press) {

**Error** Scene=Scene 1, layer=Layer 1, frame=40:Line 1: Mouse events are permitted only for button instances
on (press) {

**Error** Scene=Scene 1, layer=Layer 1, frame=80:Line 1: Mouse events are permitted only for button instances
on (press) {

**Error** Scene=Scene 1, layer=Layer 1, frame=120:Line 1: Mouse events are permitted only for button instances
on (press) {

**Error** Scene=Scene 1, layer=Layer 1, frame=160:Line 1: Mouse events are permitted only for button instances
on (press) {

Total ActionScript Errors: 5 Reported Errors: 5


Like I said, I'm only strating with Flash, and have no clue what this means. Any help would be great.

djr33
10-16-2006, 09:09 PM
You need to convert your graphic/movie clip object to a "button".

why? flash is stupid. I really don't understand why they don't merge them. BUT... that's what you've got to work with.

ptancred
10-16-2006, 09:20 PM
Thank you very much. Now... how do I do that? lol.

I bought a book, and Im working through it, but it asnt covered this yet.

djr33
10-16-2006, 11:31 PM
It's not too hard to find. I don't have flash open at the moment.
Right click it, convert to button. Or somehting like that. In a menu?
Just look around... should be there.
I think it might be in the properties window too.
Might depend on your version of flash, too.

BLiZZaRD
10-17-2006, 09:25 AM
If you have version 7 (MX2004) or version 8, MCs can have button attributes.

Select the item you want to be clickable and when the whole thing is selected right click and choose "convert to symbol"

the pop up that shows up, give it a name, and select "button" click okay and viola, done

However, the code above wont do too well anymore (past version 5) as "diff" isn't recognized anymore.

instead once you have your button, click ONCE on it, open the ActionScripts panel and put this:



on(release){
getURL("http://yoursite.com" _blank);
}


Thats it. :D