Thanks Claus.
I coppied your code and it worked. Yet it is almost the same as mine.
Thanks again.
Ryan
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Claus Wahlers
Sent: Wed 9/20/2006 4:20 PM
To: Flashcoders mailing list
Cc:
Subject: Re: [Flashcoders] SMIL xml parsing weirdness.
Works for me:
var self:MovieClip = this;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(ok:Boolean) { self.doStuff(ok); }
xml.load("soap.xml");
stop();
function doStuff(ok:Boolean):Void {
var bitrate:String =
xml.firstChild.firstChild.nextSibling.firstChild.firstChild.attributes["system-bitrate"];
trace(parseInt(bitrate));
}
Cheers,
Claus.
Ryan Potter wrote:
> Hello list.
>
> I have been working on parsing a smil xml file so that I can detect
> bandwidth for an flv player. I am getting the xml output from a PHP
> script and I am using xml.sendAndLoad(). That all works just fine. I
> can get the xml object back and I can parse through it and get the
data
> out with one strange exception.
>
> When I try to parse the video node "system-bitrate" attribute I can't
> get the value. I have tried to turn it into a number, or a string
> (which it is). The weird thing is that if I trace it out it says it
is
> "NaN". If I look at the type it is "string". Then why won't it let
me
> read it???????
>
> The weird part is that if I change the name of the attribute to
> "bitrate" or just about any other name it works. Is it the dash in
the
> attribute name?
>
> Has anyone seen this behavior??
>
> Thanks,
> Ryan
>
> Here is my smil file:
>
> <smil>
> <head>
> <meta base="rtmp://myflvserver/blahblah/flash/1/" />
> <layout>
> <root-layout width="480" height="360" />
> </layout>
> </head>
> <body>
> <switch>
> <video src="rl512k.flv"
> system-bitrate="512000"/>
> <ref src="rl256k.flv"/>
> </switch>
> </body>
> </smil>
>
> SMIL xml parsing weirdness.
--
claus wahlers
cĂ´deazur brasil
http://codeazur.com.br
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com