homepage Welcome to WebmasterWorld Guest from 54.198.224.121
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Flash "on (release)" event to go to URL doesn't work.
hp_solomon




msg:4126721
 2:26 pm on May 4, 2010 (gmt 0)

I created a banner flash that has onclick event to go to a website but it doesn't work. Clicking the flash does nothing.

Here is the actionscript attached to a flash button movie.

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


here is the flash html code

<object id="banner" type="application/x-shockwave-flash" data="http://www.example.com/static/image/ads/sennheiser.swf" width="234" height="60">
<param name="movie" value="http://www.example.com/static/image/ads/sennheiser.swf" />
<param name="wmode" value="transparent" />
</object>


what could be wrong?

please advice.

thanks in advance.

[edited by: eelixduppy at 2:18 am (utc) on May 5, 2010]
[edit reason] exemplified [/edit]

 

rocknbil




msg:4126857
 6:24 pm on May 4, 2010 (gmt 0)

Try something like this:

Create a TOPMOST layer, name it movieButton. In this layer, create a plain rectangular box the size of the movie. Use the properties pane to set it's width and height exactly the size of the movie with the x and y coordinates set to 0 and 0.

Select the box, and in the color pane (or the properties pane, doesn't matter) set it's opacity (alpha) to 0 to make it transparent.

With it still selected, from the Modify menu, select "convert to Symbol." Set the symbol type as BUTTON (not movie or graphic.)

Name the instance of the button on the stage. "myButton" for example.

Create a layer for ActionScript, and in the first frame of the timeline,

_root.myButton.onRelease = function() {
getURL('https://www.example.com');
}

Save, export, test, this will work. :-)

hp_solomon




msg:4127026
 12:57 am on May 5, 2010 (gmt 0)

Hi,

Thank you for the reply. I already applied this and it works if I access the swf flash banner directly from the browser and if i created an html with only this flash banner included in the file.

http://www.example.com/static/image/ads/sennheiser.swf

But when I included the flash banner in my site (phpfox site) it doesn't work.

What could be the problem?

Thanks in advance.

[edited by: eelixduppy at 2:19 am (utc) on May 5, 2010]
[edit reason] exemplified [/edit]

rocknbil




msg:4127078
 2:10 am on May 5, 2010 (gmt 0)

Well, you're using the <object> element, which generally only works with IE, if you use FF, it won't fly. Look into SWFObject.

hp_solomon




msg:4127081
 2:29 am on May 5, 2010 (gmt 0)

tested this on IE and it wont work too.


<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="234" height="60" id="Sennheiser-banner-f8" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="http://www.example.com/static/image/ads/sennheiser.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="http://www.example.com/static/image/ads/sennheiser.swf" quality="high" bgcolor="#000000" width="234" height="60" name="Sennheiser-banner-f8" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>


it's weird that it works when i access the swf file directly from firefox or any browser or a plain html file but when i attach it to my site (phpfox) it doesn't work.

What could be the problem?

[edited by: eelixduppy at 3:45 am (utc) on May 5, 2010]
[edit reason] exemplified [/edit]

hp_solomon




msg:4127278
 11:36 am on May 5, 2010 (gmt 0)

anyone?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved