corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Script to auto activate flash elemtns in web pages... inside » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Antz

posted on 23rd Jan 07 at 00:55

the way that page explains it all is like going via london to get from Leeds to Brdford... mins is simple... but not o efective.


Antz

posted on 23rd Jan 07 at 00:53

yeah, that's all my code will do... it writes the object from outide the file and iserts it back in


James

posted on 23rd Jan 07 at 00:38

Theres a press release article thingy about it here

http://www.adobe.com/devnet/activecontent/articles/devletter.html


Antz

posted on 23rd Jan 07 at 00:36

Oh.... I tried this on 2 flash elements on one page but it did wierd things...

It seems only to work on one element per page.. wich is ok for now, I guess.


Antz

posted on 23rd Jan 07 at 00:34

Wrap your embedded content in a <noscript> tag with class="ACSel". eg:
<noscript class="ACSel">
<object classid=".....>
....
</object>
</noscript>

Then add this to your <head>:

<script type="text/javascript" src="activecontent.js"> </script>

Add 'onload="rewriteContent();"' to your body tag.

Finally create a file called "activecontent.js" with the below script. Note, you have to put the function in an external script. It cannot be in-line...

code:

function rewriteContent() {
var v=document.getElementsByTagName("noscript");
for(i=0;i<v.length;i++){
if(v.className=="ACSel"){
var el=v;
var nel=document.createElement("span");//create new span element to hold content
nel.innerHTML=el.innerHTML;// fill the newly inserted span with the active content
el.parentNode.replaceChild(nel,el); // and replace the <noscript> element with the <span> element
}
}
}


[Edited on 23-01-2007 by Antz]