Thanks Aran, that worked perfect.

On Feb 4, 7:52 pm, "Aran Rhee" <[email protected]> wrote:
> So you are on the right track with Philip's (pipwerks) onclick 
> examplehttp://www.pipwerks.com/lab/swfobject/load-onclick/2.0/index.html
>
> You just want to modify the loadSWF function to take in a width and height
> parameters like below, rather than passing the data into the swf itself.
>
> function loadSWF(url, targetID, w, h){
>         //Check for existing SWF
>         if(isObject(targetID)){
>                 //replace object/element with a new div
>                 replaceSwfWithEmptyDiv(targetID);
>         }
>         //Embed SWF
>         if (swfobject.hasFlashPlayerVersion("8")) {
>                 var attributes = { data: url, width:w, height :h };
>                 var params = {};
>                 var obj = swfobject.createSWF(attributes, params, targetID);
>         }
>
> <a href="movie2.swf" onclick="loadSWF(this.href, 'flashcontent', 300, 300);
> return false;">Click here to load a sample SWF</a>
>
> You could also paramitize the flash player version or other params etc if
> required
>
> Cheers,
> Aran
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
>
> Behalf Of KCWebPlaza
> Sent: Thursday, 5 February 2009 6:45 AM
> To: SWFObject
> Subject: Width and Height Passed as URL Parameters
>
> I'm trying to use SWFObject version 2.1 to load multiple swf files
> into a <DIV> tag via hyperlinks on the page when the SWF files loaded
> will have different heights and widths.These SWF movies are not
> produced by me, so I cannot edit the ActionScript in them.
>
> Can I pass the width and height as URL parameters - as I can do with
> the src filename?
>
> This is the basic code:
> <a href="/lab/_common/sample.swf" onclick="loadSWF(this.href,
> 'flashcontent'); return false;">Click here to load a sample SWF</a>
>
> <a href="movie2.swf?width=300&height=300" onclick="loadSWF(this.href,
> 'flashcontent'); return false;">Click here to load a sample SWF</a>
> <a href="movie3.swf?width=600&height=400" onclick="loadSWF(this.href,
> 'flashcontent'); return false;">Click here to load a sample SWF</a>
>
> I'm trying to add in url parameters for the width and height for each
> hyperlinks that loads a SWF movie. The swf filename is passed just
> fine as data:url, but my experimentation with width and height has not
> worked so far.
>
> Here's the sample of the SWFObject code I believe is relevant:
>
> <script type="text/javascript">
> function loadSWF(url, targetID){
>         //Check for existing SWF
>         if(isObject(targetID)){
>                 //replace object/element with a new div
>                 replaceSwfWithEmptyDiv(targetID);
>         }
>         //Embed SWF
>         if (swfobject.hasFlashPlayerVersion("7")) {
>                 var attributes = { data: url, width:"550", height:"400" };
>                 var params = {};
>                 var obj = swfobject.createSWF(attributes, params, targetID);
>         }
>
> Thx!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to