Question
XML loading and scope problem
This is a multi-part message in MIME format.
------=_NextPart_000_0028_01C6E6E6.7CF11A00
Content-Type: text/plain;
charset="iso-8859-9"
Content-Transfer-Encoding: quoted-printable
hi,
when XML file loaded, i dont understand onloaded function scope and i =
cant use scope what I want.
code below:=20
class VoteChoicesGroup extends MovieClip
{
private var choicesXML : XML;
function VoteChoicesGroup ()
{
MC =3D this;
choicesXML =3D new XML ();
choicesXML.onLoad =3D choicesLoaded;
choicesXML.ignoreWhite =3D true;
choicesXML.load ("XML/mainPageVoteChoices.xml");
}
=
/////////////////////////////////////////////////////////////////////////=
//////
function choicesLoaded (success : Boolean) : Void
{
var choices : XMLNode =3D this ["childNodes"][0];
if (success)
{
MC.item0.assignTitle (choices.childNodes [0].firstChild)
trace ('MC: ' + MC)// this return as "undefined"
}
}
}
how can I reach top scope? I mean how can I see MC?
Note: I thought using AddEventListener...but i cant use it on XML class =
:)
regards
------=_NextPart_000_0028_01C6E6E6.7CF11A00
Content-Type: text/html;
charset="iso-8859-9"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-9">
<META content=3D"MSHTML 6.00.5346.5" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>when XML file loaded, i dont understand =
onloaded=20
function scope and i cant use scope what I want.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>code below: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier New"><FONT =
color=3D#800000>class=20
VoteChoicesGroup extends MovieClip<BR></FONT>{<BR> private var =
choicesXML :=20
XML;<BR> function VoteChoicesGroup =
()<BR> {<BR> <FONT=20
color=3D#ff0000>MC =3D this;<BR></FONT> choicesXML =3D new =
XML=20
();<BR> choicesXML.onLoad =3D=20
choicesLoaded;<BR> choicesXML.ignoreWhite =3D=20
true;<BR> choicesXML.load=20
("XML/mainPageVoteChoices.xml");<BR> }<BR> ////////////////////=
///////////////////////////////////////////////////////////<BR> <FON=
T=20
color=3D#008000>function choicesLoaded (success : Boolean) :=20
Void</FONT><BR> {<BR> var choices : XMLNode =3D this=20
["childNodes"][0];<BR> if=20
(success)<BR> {<BR> MC.item0.assignTitle=20
(choices.childNodes [0].firstChild)<BR> <FONT=20
color=3D#ff0000>trace ('MC: ' + MC)// this return as=20
"undefined"</FONT></FONT></FONT></DIV><FONT face=3DArial size=3D2><FONT=20
face=3D"Courier New"><FONT color=3D#ff0000>
<DIV><BR></FONT> }<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV></FONT><FONT face=3DArial>how can I reach top scope? I mean how can =
I see=20
MC?</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>Note: I thought using AddEventListener...but i =
cant use it=20
on XML class :)</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>regards</DIV>
<DIV><BR> </FONT></FONT></DIV></BODY></HTML>
------=_NextPart_000_0028_01C6E6E6.7CF11A00--
------=_NextPart_000_0028_01C6E6E6.7CF11A00
Content-Type: text/plain;
charset="iso-8859-9"
Content-Transfer-Encoding: quoted-printable
hi,
when XML file loaded, i dont understand onloaded function scope and i =
cant use scope what I want.
code below:=20
class VoteChoicesGroup extends MovieClip
{
private var choicesXML : XML;
function VoteChoicesGroup ()
{
MC =3D this;
choicesXML =3D new XML ();
choicesXML.onLoad =3D choicesLoaded;
choicesXML.ignoreWhite =3D true;
choicesXML.load ("XML/mainPageVoteChoices.xml");
}
=
/////////////////////////////////////////////////////////////////////////=
//////
function choicesLoaded (success : Boolean) : Void
{
var choices : XMLNode =3D this ["childNodes"][0];
if (success)
{
MC.item0.assignTitle (choices.childNodes [0].firstChild)
trace ('MC: ' + MC)// this return as "undefined"
}
}
}
how can I reach top scope? I mean how can I see MC?
Note: I thought using AddEventListener...but i cant use it on XML class =
:)
regards
------=_NextPart_000_0028_01C6E6E6.7CF11A00
Content-Type: text/html;
charset="iso-8859-9"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-9">
<META content=3D"MSHTML 6.00.5346.5" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>when XML file loaded, i dont understand =
onloaded=20
function scope and i cant use scope what I want.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>code below: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier New"><FONT =
color=3D#800000>class=20
VoteChoicesGroup extends MovieClip<BR></FONT>{<BR> private var =
choicesXML :=20
XML;<BR> function VoteChoicesGroup =
()<BR> {<BR> <FONT=20
color=3D#ff0000>MC =3D this;<BR></FONT> choicesXML =3D new =
XML=20
();<BR> choicesXML.onLoad =3D=20
choicesLoaded;<BR> choicesXML.ignoreWhite =3D=20
true;<BR> choicesXML.load=20
("XML/mainPageVoteChoices.xml");<BR> }<BR> ////////////////////=
///////////////////////////////////////////////////////////<BR> <FON=
T=20
color=3D#008000>function choicesLoaded (success : Boolean) :=20
Void</FONT><BR> {<BR> var choices : XMLNode =3D this=20
["childNodes"][0];<BR> if=20
(success)<BR> {<BR> MC.item0.assignTitle=20
(choices.childNodes [0].firstChild)<BR> <FONT=20
color=3D#ff0000>trace ('MC: ' + MC)// this return as=20
"undefined"</FONT></FONT></FONT></DIV><FONT face=3DArial size=3D2><FONT=20
face=3D"Courier New"><FONT color=3D#ff0000>
<DIV><BR></FONT> }<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV></FONT><FONT face=3DArial>how can I reach top scope? I mean how can =
I see=20
MC?</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>Note: I thought using AddEventListener...but i =
cant use it=20
on XML class :)</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>regards</DIV>
<DIV><BR> </FONT></FONT></DIV></BODY></HTML>
------=_NextPart_000_0028_01C6E6E6.7CF11A00--