Results 1 to 4 of 4

Thread: Switch Content Script and flash buttons

  1. #1
    Join Date
    Nov 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switch Content Script and flash buttons

    1) Script Title: Switch Content Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tchcontent.htm

    3) Describe problem: I'm looking to use a flash button or movie clip instead of the typical text used in this script. I have my page set up as such

    Code:
    HTML Code:
       <span id="bobcontent1-title" class="handcursor">
                           
    
    	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="200" height="50" id="bobcontent1-title" align="middle">
    	<param name="allowScriptAccess" value="sameDomain" />
    	<param name="allowFullScreen" value="false" />
    	<param name="movie" value="tester.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="tester.swf" quality="high" bgcolor="#ffffff" width="200" height="50" name="tester" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    	</object>
    
                            
                            
    </span>
    Basically I thought wrapping a span tag around it would do the trick, but it didn't. I also tried to declare the bobcontent in the id of the flash object, but that didn't work either. Does anyone have any suggestions, or know how to do this?

    Thanks

    Rob

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    This will only work if your Flash code triggers a JavaScript onClick event when clicked on. Basically, if you can embed your Flash code in a way that you get an alert message when the below is clicked on?

    Code:
    <span onClick="alert('hi')">
    Flash code here
    </span>
    I'm not familiar enough with Flash to know exactly what needs to be done unfortunately.
    DD Admin

  3. #3
    Join Date
    Nov 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think I know what you mean, I will find out exactly how to get the flash to trigger a javascript action and post it in here

    So just to make sure I'm on the right page, I would need my flash button to trigger a javascript variable, and then call that within the span on the onclick?

    Thanks for your help!

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    So just to make sure I'm on the right page, I would need my flash button to trigger a javascript variable, and then call that within the span on the onclick?
    Not exactly. You want to either:

    1) Configure your Flash code so clicking on it causes the onClick event handler of the containing SPAN to fire. In the above sample, an alert message will pop up if successful:

    Code:
    <span onClick="alert('hi')">
    Flash code here
    </span>
    OR

    2) Modify your Flash code to call a JavaScript code when clicked on, or the direct approach:

    <span>
    Code:
    	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="200" height="50" id="bobcontent1-title" align="middle">
            <param onClick="alert('hi')" />
    	</object>
    </span>

    For the later, that's just a mockup, as I have no idea how or if Flash can call a JavaScript code when clicked on directly.
    DD Admin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •