Forum Moderators: open

Message Too Old, No Replies

Making entire movie a clickable link

Flash MX

         

Chroder

4:17 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



I've tried, but can't figure it out. I've made a flash banner advert for my site but I can't figure out how to make it clickable.

I want it so that once clicked, it goes to a URL I specify.

Any help is appreciated :)

benihana

4:27 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



create a layer at the bottom of all layers, draw a rectangle the size of your movie - i.e. completely filling the stage. press f8 to convert to symbol (a 'graphic' type should do i think).
now click on the rectangle and add this actionscript:

onRelease {
getURL ("http://www.example.com");
}

cant remember if you need the quotes "" or not...

theres probably a better way, but this should do the trick

Chroder

5:01 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



I keep getting errors:

**Error** Scene=Scene 1, layer=Layer 12, frame=1:Line 1: Syntax error.
onRelease {

Total ActionScript Errors: 1 Reported Errors: 1

Any ideas?

My code:

onRelease {
getURL("http://google.com", "_self");
}

benihana

6:43 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



which version of flash are you using?

tried this in mx:

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

}
and it works

not sure if the syntax has changed in mx2004, or if i imagined it. sorry :)

also you may have to use a movie clip, not graphic symbol type

ben

Chroder

12:45 am on Oct 21, 2003 (gmt 0)

10+ Year Member



Sorry Ben, I didn't realize there were syntax differences in MX and MX2004 :) Your second code worked - thank you!

benihana

8:10 am on Oct 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



just checked in 2004 - it hasnt changed - dont know where i got onRelease from.
sorry;
:(

mikepitches

12:50 pm on Feb 23, 2008 (gmt 0)

10+ Year Member



Hi
Didn't work for me - I've never been able to suss this out.
Followed the advice to the letter (and more) but I get "Current selection cannot have actions applied to it".
I'm using Flash MX2004 Pro.
Any further help much appreciated.

daperson0

10:23 pm on Feb 28, 2008 (gmt 0)

10+ Year Member



Nooo!
Simply put something such as

myClip.onRelease = function() {
//do stuff
getURL("www.something.com", "_blank");
}

Where myClip is the instance name of the clip in question relative to the place in which you put this code.