View Full Version : How do I give html link to flash files in Macromedia flash ?
linux1880
03-14-2008, 01:27 PM
I did create a flash file, now i want to put it on my webpage and give html link to it. I went to action and found getURL
getURL(http://mysite.com);
it's giving me error, what and where do I give link and also do i save the image as ,fla or swf to publish in the web page ? Thank you
Medyman
03-14-2008, 07:41 PM
are you trying to link the entire flash movie to a link? or a button within the flash?
simply putting getURL() into the actions layer (or wherever else you have it) won't do anything. You need to apply that action to an object (a movieclip or button).
If you're linking the entire movie to a webpage...
1) Create a rectangle that covers the entire stage, set it's alpha to 0
2) Turn that rectangle into a movieclip and give it an instance name in the properties panel
3) In the actions panel, add:
instance_name.onRelease = function() {
getURL("http://www.mysite.com");
}
just replace instance_name with the instance name of the rectangle (or button, if you're linking a button).
linux1880
03-14-2008, 10:31 PM
I did create new symbol and named it link , set it to alpha 0
and I went to action panel > Global function > Browser/Network > GetUrl and added
link.onRelease = function() {
getURL("http://mysite.com");
}
but it didn't work
linux1880
03-14-2008, 10:32 PM
PS: I want to link it to whole movie. Thanks
Medyman
03-15-2008, 12:08 AM
Is the actionscript on the save frame as the movie clip?
linux1880
03-15-2008, 12:23 AM
yes it is, when i clicked check syntax it gave me this error
**Error** Scene=Scene 1, layer=Layer 7, frame=1:Line 1: Statement must appear within on/onClipEvent handler
action1.onRelease = function() {
Total ActionScript Errors: 1 Reported Errors: 1
Medyman
03-15-2008, 01:50 AM
ahhh, so it's not on a frame at all. you're adding it directly to the object.
i don't advise that, but if you're doing it that way the syntax is different.
use:
on(release) {
getURL("site.com");
}
The other code would be appropriate for an actions layer, added to the timeline.
linux1880
03-15-2008, 08:07 AM
Sorry, I am getting this error again, I don't know where I have done wrong, I am new in flash :(
**Error** Scene=Scene 1, layer=Layer 6, frame=101:Line 1: Mouse events are permitted only for button instances
on (release) {
Total ActionScript Errors: 1 Reported Errors: 1
Medyman
03-15-2008, 03:44 PM
What version of Flash are you using? Must be Flash 5 or before. I assumed you were using AS 2.0, sorry! I don't really encounter many people using anything lower than Flash 8 (sometimes a few MX 2004 users, but certainly not Flash 5).
Go into the properties of that movie clip and chang the type to "Button" instead of "Movie Clip".
linux1880
03-16-2008, 08:31 PM
hi medyman , I am using MX2004, sorry I am new in flash, may be I am not being able to explain you correctly. But Is there a short cut way, so that I just put url and it will work ? Thank you so much for the help.
Medyman
03-16-2008, 09:13 PM
hi medyman , I am using MX2004, sorry I am new in flash, may be I am not being able to explain you correctly. But Is there a short cut way, so that I just put url and it will work ? Thank you so much for the help.
Hmm...then not sure why that error is coming up.
This would be the easiest way of getting an entire flash movie to link to a page.
You could also do it with HTML and invisible absolute positioned divs.
If you want, put your .fla online somewhere and i'll have a look to see what the issue is.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.