[SWFObject] Stage.width of "0" at random in IE...
Michael Ypes
michael.ypes at the3rdroom.com
Thu Jun 1 07:12:44 PDT 2006
Yep that'll be me and I believe it was one of the first blogs on this site
as no one answered my plea for help...
Basically I was using flash to write nice text headers in a html site and
the width and height of the text field would be the width and height of the
stage. I was writing loads of them on a page and sometimes they wouldn't
appear and sometimes they would. After lots of banging my head against brick
walls I worked out that the reason there weren't showing is that the width
of the stage was reading 0 and therefore the text box was not visible.
The detection I used is below and that has fixed the problem, hope this
helps mate...
Basically I detected that the swf had loaded doing a normal getBytes type
stuff and then did another onEnterFrame to detect the stage width.
if(Stage.width!=0){
oTxt._width = Stage.width;
oTxt._height = Stage.height;
oTxt.htmlText = "Blab la bla";
oTxt._visible = 1;
this.stop();
};
I have stripped out the other code but it can seen in action at
http://www.xpango.com
-----Original Message-----
From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Geoff Stearns
Sent: 01 June 2006 15:03
To: swfobject at lists.deconcept.com
Subject: Re: [SWFObject] Stage.width of "0" at random in IE...
I think someone else had this issue a long time ago - it might just
be the way that IE initializes the plugin when you write it out with
javascript.
if you are getting the width on the first frame, try doing it on
frame 2 instead.
On Jun 1, 2006, at 1:04 AM, andrewbadke at austar.com.au wrote:
> Hi everyone,
>
> I've found a strange bug occurring with swfobject in divs in IE.
> sometimes
> the stage.width parameter in the movie reads 0, completely at
> random. Just
> seeing if this is a problem other people have found and whether its
> regarding a certain version of the flash activex player, the swfobject
> itself, or the css rules that are being used in the containing DIV.
>
> Cheers
>
> __________________________
> Andy Badke
> Austar Communications Pty Ltd
>
>
>
> ------------------------------
> +------------------------------------------|
>
> | |
>
> | |
> swfobject-
> r| To|
> equest at list|
> swfobject at lists.deconcept.com |
>
> s.deconcept| cc|
> .com
> | |
> Sent by: |
> Subject|
> swfobject-b| SWFObject Digest, Vol 2,
> Issue |
> ounces at list|
> 86 |
>
> s.deconcept| |
> .com
> | |
>
> | |
> 01/06/2006
> | |
> 12:21 PM
> | |
>
> | |
>
> Ple| |
>
> ase| |
>
> res| |
>
> pon| |
> d
> | |
> to
> | |
>
> swf| |
>
> obj| |
>
> ect| |
>
> @li| |
>
> sts| |
> .de|
> |
>
> con| |
>
> cep| |
>
> t.c| |
> om
> | |
>
> | |
>
> | |
>
> | |
>
> | |
>
> | |
> ------------------------------
> +------------------------------------------|
>
>
>
>
> Send SWFObject mailing list submissions to
> swfobject at lists.deconcept.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
> or, via email, send a message with subject or body 'help' to
> swfobject-request at lists.deconcept.com
>
> You can reach the person managing the list at
> swfobject-owner at lists.deconcept.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of SWFObject digest..."
>
>
> Today's Topics:
>
> 1. Re: Bug in getQueryParamValue() function. Slight fix ? (Aran
> Rhee)
> 2. Re: Bug in getQueryParamValue() function. Slight fix ? (Aran
> Rhee)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 1 Jun 2006 12:19:48 +1000
> From: "Aran Rhee" <aran.rhee at gmail.com>
> Subject: Re: [SWFObject] Bug in getQueryParamValue() function. Slight
> fix ?
> To: <swfobject at lists.deconcept.com>
> Message-ID: <008301c68521$ddf5db50$2000a8c0 at HYPERION>
> Content-Type: text/plain; charset="us-ascii"
>
> Geoff.
>
> Yep, My bad. I was remembering an earlier incarnation on my machine
> which
> had a full if/else block, so I did have a 3rd return in there. It
> then got
> ditched it when I was looking at compacting/optimising the code.
> Been a
> long
> day.... :)
>
> Cheers,
>
> Aran
>
>
> _____
>
> From: swfobject-bounces at lists.deconcept.com
> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Geoff
> Stearns
> Sent: Thursday, 1 June 2006 11:48 AM
> To: swfobject at lists.deconcept.com
> Subject: Re: [SWFObject] Bug in getQueryParamValue() function.
> Slight fix ?
>
>
> it will still return "" if it doesn't find anything...
>
> the extra return was redundant as it will just do nothing once the
> loop is
> done.
>
> you can test this by going to my test page and putting this in the
> address
> bar:
>
> javascript:alert(getQueryParamValue("test"));
>
>
> here's the test page url:
> http://dev.deconcept.com/1.4.2_test/swfobject.html
>
>
>
>
> you'll see it alert an empty string.
>
>
>
>
>
>
>
> On May 31, 2006, at 8:23 PM, Aran Rhee wrote:
>
>
> Geoff.
>
> Great. One thing though. I think we still need to have an empty string
> return if it loops through all the pairs and doesn't find a match.
> The one
> return you have at present returns an empty string only if there is no
> query
> string found at all. ( need 3 returns in total as below)
>
> deconcept.util =
> {
> getRequestParameter: function(param)
> {
> var q = document.location.search || document.location.hash;
> if(q)
> {
> var pairs = q.substring(1).split("&");
> for (var i=0; i < pairs.length; i++)
> {
> if (pairs[i].substring(0, pairs[i].indexOf("=")) == param)
> {
> // return matched key value
> return pairs[i].substring((pairs[i].indexOf("=")+1));
> }
> }
> // empty string if no match found
> return "";
> }
> // empty string if no querystring at all
> return "";
> }
> }
>
>
> Cheers,
>
> Aran
>
>
>
>
>
> _____
>
> From: swfobject-bounces at lists.deconcept.com
> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Geoff
> Stearns
> Sent: Thursday, 1 June 2006 1:40 AM
> To: swfobject at lists.deconcept.com
> Subject: Re: [SWFObject] Bug in getQueryParamValue() function. Please
> fixASAP.
>
>
> just checked it in, have a look:
>
> http://svn.deconcept.com/swfobject/trunk/
>
>
>
> On May 31, 2006, at 11:29 AM, Geoff Stearns wrote:
>
>
> nice catch - i like your compact version better than my fix for it,
> so if
> you don't mind i'll roll it into the next version:
>
> deconcept.util = {
> getRequestParameter: function(param) {
> var q = document.location.search || document.location.hash;
> if(q) {
> var pairs = q.substring(1).split("&");
> for (var i=0; i < pairs.length; i++) {
> if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
> return pairs[i].substring((pairs[i].indexOf("=")+1));
> }
> }
> }
> return "";
> }
> }
>
> i'm going to check this into the svn repository in a few mins, i
> have a
> couple other things to test first.
>
>
>
> On May 31, 2006, at 12:17 AM, Aran Rhee wrote:
>
>
> Geoff.
>
> I believe I have found a bug in your query params function with
> swfObject.
> The way you are returning values from your search means that it
> will return
> the value of the 1st parameter which contains the substring of the
> name
> passed into getQueryParamValue(), not necessarily the actual value you
> want!
>
>
> e.g.
>
> somepage.html?myEmailName=aaaa at aaaa.com&Email=xxxx at xxxx.com
> <mailto:somepage.html?myEmailName=aaaa at aaaa.com&Email=xxxx at xxxx.com>
>
> getQueryParamValue('Email');
>
> will actually return <mailto:aaaa at aaaa.com> aaaa at aaaa.com, as the
> value as
> "Email" was found in the 1st param name string.
>
>
> I think you need to actually split the params into an array and do
> a full
> text match. I wrote the below as a fix for myself quickly, and
> itdesigned
> to
> be readable, not compact, but you get the idea.
>
> function getRequestParameter (key)
> {
> var q = document.location.search || document.location.hash;
> if(q)
> {
> var qArray = q.substring(1).split("&");
> var len = qArray.length;
> for (i = 0; i<len; i++)
> {
> var pair = qArray[i];
> var splitIndex = pair.indexOf("=");
> var paramName = pair.substring(0, splitIndex);
> var paramValue= pair.substring((splitIndex+1));
> if (paramName == key)
> {
> return paramValue;
> }
> }
> return "";
> }
> return "";
> }
>
>
> You could compact it like:
>
> function getRequestParameter (key) {
> var q = document.location.search || document.location.hash;
> if(q) {
> var qArray = q.substring(1).split("&");
> for (i = 0; i<qArray.length; i++) {
> if (qArray[i].substring(0, qArray[i].indexOf("=")) == key) return
> qArray[i].substring((qArray[i].indexOf("=")+1));
> }
> return "";
> }
> return "";
> }
>
>
>
>
> Cheers,
>
> Aran
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> /pipermail/swfobject-deconcept.com/attachments/20060601/d3a46b49/
> attachment-0001.htm
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 1 Jun 2006 12:20:25 +1000
> From: "Aran Rhee" <aran.rhee at qdc.net.au>
> Subject: Re: [SWFObject] Bug in getQueryParamValue() function. Slight
> fix ?
> To: <swfobject at lists.deconcept.com>
> Message-ID: <008801c68521$f4eaee90$2000a8c0 at HYPERION>
> Content-Type: text/plain; charset="us-ascii"
>
> Geoff.
>
> Yep, My bad. I was remembering an earlier incarnation on my machine
> which
> had a full if/else block, so I did have a 3rd return in there. It
> then got
> ditched it when I was looking at compacting/optimising the code.
> Been a
> long
> day.... :)
>
> Cheers,
>
> Aran
>
>
> _____
>
> From: swfobject-bounces at lists.deconcept.com
> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Geoff
> Stearns
> Sent: Thursday, 1 June 2006 11:48 AM
> To: swfobject at lists.deconcept.com
> Subject: Re: [SWFObject] Bug in getQueryParamValue() function.
> Slight fix ?
>
>
> it will still return "" if it doesn't find anything...
>
> the extra return was redundant as it will just do nothing once the
> loop is
> done.
>
> you can test this by going to my test page and putting this in the
> address
> bar:
>
> javascript:alert(getQueryParamValue("test"));
>
>
> here's the test page url:
> http://dev.deconcept.com/1.4.2_test/swfobject.html
>
>
>
>
> you'll see it alert an empty string.
>
>
>
>
>
>
>
> On May 31, 2006, at 8:23 PM, Aran Rhee wrote:
>
>
> Geoff.
>
> Great. One thing though. I think we still need to have an empty string
> return if it loops through all the pairs and doesn't find a match.
> The one
> return you have at present returns an empty string only if there is no
> query
> string found at all. ( need 3 returns in total as below)
>
> deconcept.util =
> {
> getRequestParameter: function(param)
> {
> var q = document.location.search || document.location.hash;
> if(q)
> {
> var pairs = q.substring(1).split("&");
> for (var i=0; i < pairs.length; i++)
> {
> if (pairs[i].substring(0, pairs[i].indexOf("=")) == param)
> {
> // return matched key value
> return pairs[i].substring((pairs[i].indexOf("=")+1));
> }
> }
> // empty string if no match found
> return "";
> }
> // empty string if no querystring at all
> return "";
> }
> }
>
>
> Cheers,
>
> Aran
>
>
>
>
>
> _____
>
> From: swfobject-bounces at lists.deconcept.com
> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Geoff
> Stearns
> Sent: Thursday, 1 June 2006 1:40 AM
> To: swfobject at lists.deconcept.com
> Subject: Re: [SWFObject] Bug in getQueryParamValue() function. Please
> fixASAP.
>
>
> just checked it in, have a look:
>
> http://svn.deconcept.com/swfobject/trunk/
>
>
>
> On May 31, 2006, at 11:29 AM, Geoff Stearns wrote:
>
>
> nice catch - i like your compact version better than my fix for it,
> so if
> you don't mind i'll roll it into the next version:
>
> deconcept.util = {
> getRequestParameter: function(param) {
> var q = document.location.search || document.location.hash;
> if(q) {
> var pairs = q.substring(1).split("&");
> for (var i=0; i < pairs.length; i++) {
> if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
> return pairs[i].substring((pairs[i].indexOf("=")+1));
> }
> }
> }
> return "";
> }
> }
>
> i'm going to check this into the svn repository in a few mins, i
> have a
> couple other things to test first.
>
>
>
> On May 31, 2006, at 12:17 AM, Aran Rhee wrote:
>
>
> Geoff.
>
> I believe I have found a bug in your query params function with
> swfObject.
> The way you are returning values from your search means that it
> will return
> the value of the 1st parameter which contains the substring of the
> name
> passed into getQueryParamValue(), not necessarily the actual value you
> want!
>
>
> e.g.
>
> somepage.html?myEmailName=aaaa at aaaa.com&Email=xxxx at xxxx.com
> <mailto:somepage.html?myEmailName=aaaa at aaaa.com&Email=xxxx at xxxx.com>
>
> getQueryParamValue('Email');
>
> will actually return <mailto:aaaa at aaaa.com> aaaa at aaaa.com, as the
> value as
> "Email" was found in the 1st param name string.
>
>
> I think you need to actually split the params into an array and do
> a full
> text match. I wrote the below as a fix for myself quickly, and
> itdesigned
> to
> be readable, not compact, but you get the idea.
>
> function getRequestParameter (key)
> {
> var q = document.location.search || document.location.hash;
> if(q)
> {
> var qArray = q.substring(1).split("&");
> var len = qArray.length;
> for (i = 0; i<len; i++)
> {
> var pair = qArray[i];
> var splitIndex = pair.indexOf("=");
> var paramName = pair.substring(0, splitIndex);
> var paramValue= pair.substring((splitIndex+1));
> if (paramName == key)
> {
> return paramValue;
> }
> }
> return "";
> }
> return "";
> }
>
>
> You could compact it like:
>
> function getRequestParameter (key) {
> var q = document.location.search || document.location.hash;
> if(q) {
> var qArray = q.substring(1).split("&");
> for (i = 0; i<qArray.length; i++) {
> if (qArray[i].substring(0, qArray[i].indexOf("=")) == key) return
> qArray[i].substring((qArray[i].indexOf("=")+1));
> }
> return "";
> }
> return "";
> }
>
>
>
>
> Cheers,
>
> Aran
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> /pipermail/swfobject-deconcept.com/attachments/20060601/89aba7b6/
> attachment.html
>
>
> ------------------------------
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
> End of SWFObject Digest, Vol 2, Issue 86
> ****************************************
>
> ========================================================
> This Message has been scanned for Viruses by AUSTAR Communications
> Antivirus and content checking applications.
> AUSTAR Communications
> ========================================================
>
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
_______________________________________________
SWFObject mailing list
SWFObject at lists.deconcept.com
http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
More information about the Swfobject
mailing list