Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » How to href the swf file?


How to href the swf file?

Reply
  #1 (permalink)  
Old 05-01-04, 03:49 AM
engrkhalid engrkhalid is offline
New Member
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
How to href the swf file?

Hello,,

I have a flash (swf) file,, and it is not clickable,,
How to make it clickable using html or javascript? like <img> tag, when you add (href) attribute, it became clickable.


Any help please.

Last edited by engrkhalid; 05-01-04 at 03:54 AM.
Reply With Quote
  #2 (permalink)  
Old 05-01-04, 05:39 AM
kasic's Avatar
kasic kasic is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Serbia
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
I dont understand what you mean 'not clickable' explain more specific, please

you mean that when you click onto flash thing then you go to some place else?

if so you need to draw a square all over the work area in Flash and then select this square (or what ever shape that can be depends on what shape have your flash file) press F8 and select Button. Double click on it and on hint (its the last field in button area) field move that square you draw into hint field leaving those three empty (double click on grey area to go back), as a result you'll get some kind of blue shape that presents button all over your flash file. Don't worry it's not visible in run time. if you want to add an action to this button right click on some kind of blue color and select action, try to locate GetURL, I can remeber where is it exacly and just put URL you desire.

hope this is it...

Last edited by kasic; 05-01-04 at 05:45 AM.
Reply With Quote
  #3 (permalink)  
Old 05-01-04, 07:51 AM
engrkhalid engrkhalid is offline
New Member
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Mr. kasic for your reply,,

Yes,, that what I ment..

But, I need to do it from the HTML or javaScript.. Can that happen?
Reply With Quote
  #4 (permalink)  
Old 05-01-04, 09:11 AM
kasic's Avatar
kasic kasic is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Serbia
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
I don't think so... maybe, but I'm not sure... if I find out I will tell you...
Reply With Quote
  #5 (permalink)  
Old 05-02-04, 05:51 AM
engrkhalid engrkhalid is offline
New Member
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thank Mr. kasic ....


and if any one knows how... tell us please..
Reply With Quote
  #6 (permalink)  
Old 06-22-06, 07:08 PM
youu youu is offline
New Member
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
I have same problem. Please some one can help!!!
Thanks a lot.
Reply With Quote
  #7 (permalink)  
Old 06-23-06, 02:35 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
if you can access the fla file, or decompile the swf file, you could place this code in your flash file:
Code:
myimage.onRelease = function(){
  getURL("http://mywebsite.com/mypage", _blank);
};
this code assumes you have a background image, on which you can click, cause flash requires an object to click on, you can't just use the application itself. replace "myimage" by the name of the background image

_blank is the same as in html: opens a new window with the page in it.

you could use html as well:
Code:
<a href="http://mywebsite.com/mypage" target="blank" border="0">swf here</a>
this should work as well

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #8 (permalink)  
Old 06-23-06, 02:37 PM
losse losse is offline
Newbie Coder
 
Join Date: Jun 2006
Location: Barrie, Ontario, Canada
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
I always wondered how to do this too... Always settled for adding an invisible button over top of the movie with this code snippet

Code:
on (release) {
	getURL("http://www.url.com", "_blank");
}
Reply With Quote
  #9 (permalink)  
Old 06-23-06, 03:22 PM
youu youu is offline
New Member
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Cool <object> tag does word in <a href >

Quote:
Originally Posted by UnrealEd
if you can access the fla file, or decompile the swf file, you could place this code in your flash file:
Code:
myimage.onRelease = function(){
  getURL("http://mywebsite.com/mypage", _blank);
};
this code assumes you have a background image, on which you can click, cause flash requires an object to click on, you can't just use the application itself. replace "myimage" by the name of the background image

_blank is the same as in html: opens a new window with the page in it.

you could use html as well:
Code:
<a href="http://mywebsite.com/mypage" target="blank" border="0">swf here</a>
this should work as well

Greetz,
UnrealEd
Thanks. But the key is swf file does not clickable. I do not know how to decompile swf file. Is any way to modify html or asp code to let this code clickable:
Code:
<a href="http://mywebsite.com/mypage" target="blank" border="0">
<OBJECT id="bannerFlash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="120" HEIGHT="600" ALIGN="" VIEWASTEXT>
			<PARAM NAME="movie" VALUE="my.swf">
			<PARAM NAME="quality" VALUE="high">
			<PARAM NAME="bgcolor" VALUE="#6666CC">
			<EMBED id="bannerFlash" src="my.swf" quality="high" bgcolor="#6666CC" WIDTH="120" HEIGHT="600" NAME="<%= strImage %>" ALIGN="right" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
		  </OBJECT>
		</a>
or let code:
Code:
<a href="http://mywebsite.com/mypage" target="blank" border="0"><img src="my.swf"></a>
works

Thanks a lot.

Last edited by Christian; 06-23-06 at 05:47 PM. Reason: Added [CODE] tags.
Reply With Quote
  #10 (permalink)  
Old 06-24-06, 02:25 PM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
here are some links toswf decompilers:
http://www.eltima.com/products/flashdecompiler/
http://www.swftools.com/tools-detail...ool=7672718848

you could download one of them, and convert your swf to an fla
than you can use a flash editor to add the getURL method

the sollution losse gave will work as well. create a new button, with transparent background and convert it to symbol (button) and name it. then place this code in the layer where the button is located:
Code:
mybutton.onRelease = function(){
  getURL("http://mywebsite.com/mypage", "_blank");
};
this should work. if you don't know how to edit and write actionscript, here are some tutorials:
http://www.actionscripts.org/tutorials.shtml
http://www.adobe.com/support/flash/a...ript_tutorial/
http://www.webdevelopersnotes.com/tu...use_drags.php3

if you search google, you'll find many more. if you need extra help, post it in the flash actionscript forum

Good Luck,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Upload, File Type Check, File Size Check CarBoffin PHP 3 04-13-04 02:26 PM
Getting the created file (fopen/fwrite) Programme PHP 5 02-14-04 03:09 PM
write to beginning of file or reverse an array of binary data abtimoteo Perl 1 01-20-04 10:09 AM
Please I Need help before all my hair is gone! LisatheNovice Perl 6 11-22-03 03:05 PM
Upload file type and size limiter! Arctic ASP 1 08-02-03 07:06 PM


All times are GMT -5. The time now is 09:25 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.