PDA

View Full Version : switchcontent using flash button



ata_gp
06-15-2007, 05:33 PM
I'm using the switchcontent script (2005 version). Now I'm trying to activate it from a flash button instead of html code (usually typing: <span onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer">find out more</font> </p>).

In flash I've inserted this button action:
on(press) {
getURL("javascript:expandcontent(this,'sc1')");
}

But, it doesn't work, nothing happens. What I'm doing wrong? I'm completely stuck!

ddadmin
06-16-2007, 02:40 AM
Hmm I'm not familiar with Flash at all, so I can't tell you exactly to embed a JavaScript function inside a Flash object. But assuming it's possible, there's nothing special about calling this particular JavaScript function.

Warning: Please include a link to the DD script in question in your post and in the correct forum. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

ata_gp
06-17-2007, 04:26 PM
Script: Switch Content Script
http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

The code I use doesn't exist at dynamicdrive.com anymore, but there's an available link right here http://t100e.com/es/switchcontent.js

turkey1605
06-18-2007, 12:02 PM
I think (I'm not really sure about Flash, either) if you put the Flash element inside a layer, and used the onclick attribute of the layer, that might work.
e.g:


<span onclick="expandcontent(this, 'sc1')">

//Flash objecty stuff in here

</span>

Then you could take that action button action from the Flash element, because the <span> would be doing that bit.

ata_gp
06-18-2007, 01:43 PM
I've trying it without success... with a flash object it doesn't work

alexjewell
06-18-2007, 03:10 PM
Eh, this is more of a flash question than a javascript one. You should've posted it in the flash section rather than here...
Sorry.