Welcome to WebmasterWorld Guest from 54.197.94.141

Forum Moderators: open

Message Too Old, No Replies

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

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

5+ Year Member



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]

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

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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. :-)
12:57 am on May 5, 2010 (gmt 0)

5+ Year Member



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]

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

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Well, you're using the <object> element, which generally only works with IE, if you use FF, it won't fly. Look into SWFObject.
2:29 am on May 5, 2010 (gmt 0)

5+ Year Member



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]

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

5+ Year Member



anyone?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month