Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 01:50
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Web Services: XML, Soap, WSDL, UDDI, and Flash Integration (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis)
| | |-+  XML.onload and ' this ' - difficult question!
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: XML.onload and ' this ' - difficult question!  (Read 3233 times)
tomtom
Server what's that
*
Posts: 1



View Profile WWW Email
« on: 01/27/02, 10:53 »

Hi!
Really Nice Board!  :)

I made a MovieClip which shows the data from a XML file.

The problem is that in the function 'xmlResponseLoaded' the 'this-
reference' points to the XML data and not to the movie-clip. I.e., the
call 'xmlSuccess()' is not '_level0.myClip.xmlSuccess', but
'_level0.xmlSuccess'.

Since 'myClip' is attached dynamically, I don't know the name of
'myClip' after it is attached (so '_level0.myClip.xmlSuccess();' will
not work)
I absolutely need the 'this-reference' in the movie-clip.

Does anyone have an idea??
Thanks much for your help!

Greetings from Germany
ralf


source:
//-----------------------------------
// Get XML-Data:
xmlResponse = new XML();
xmlResponse.onLoad = xmlResponseLoaded;
xmlResponse.load("myXML.xml");

// Wait for XML-Data:
function xmlResponseLoaded(success)
{
if (success)
{
trace("this = " add this);
xmlSuccess();
}
else {RequestStatus = "Request failed.";}
}
// XML-Load success:
function xmlSuccess()
{
//makeChart:
//...
}
Logged
Flash-db
Administrator
Systems Administrator
*****
Posts: 1867



View Profile WWW
« Reply #1 on: 01/29/02, 01:09 »

Can you call the XML function from inside of the loaded movie clip - instead of the root movie.  

Or can you load the movie onto a specific Level like Level 2 - Then just reference that Level.  This might work as well if you loaded a Movie that is not inside a MC to a different level such as 2 or 3.

What do you need to tell this Loaded movie to do.  I'm sure theirs a work around, I'm just not sure what your trying to do exactly so it's hard to find one.  I've had this problem as well in the past - and I would usually be able to get around it by calling the xml functions from inside the loaded movie clip instead of the root.  Also you can place the XML code on a frame somewhere then use the   call("FrameLabel");  function to bring the functions into the context of the Movie clip you are using.  If that makes sense at all.
Logged

-Jeff.
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything