Skip to main content
April 9, 2010
Question

undefined error

  • April 9, 2010
  • 1 reply
  • 405 views

Thanks to webqaflash - I've gotten a  little closer to resolving this

But my debugging tells me that i still have an  undefined error

I'm thinking - xml.load(filePath)

is not recognizing  the string as a file path to the XML

Does anyone have any suggestions?  thank you

var  filePath:String = new String();
filePath =_root.file;

var xml:XML =  new XML();
xml.ignoreWhite = true;
_root.xmlPath == undefined ?  xml.load(filePath) : xml.load(_root.xmlPath);

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 9, 2010

what's _root.file?

April 9, 2010

Thank you for responding

_root.file is the variable attached to the end of the embed tag for the swf.

Main.swf?

file=2030.xml

In our flash movie to get to the variable "file"

filePath = _root.file;

FilePath will equal = 2030.xml.  This is how we call embeded url variables (I'm not exactly sure what they're real name is)

The scenario is
http://www.reallivingtours.com/tours/viewTour.php?id=2092
when this URL is called by the browser
an xml file is created

I'm trying to pass the dynamic file name to the swf

Via the param

<param name="movie" value="Main.swf?file=tmp/<?php echo $tourID; ?>.xml">

<param name="flashvars" value="&file=tmp/<?php echo $tourID; ?>.xml">

kglad
Community Expert
Community Expert
April 9, 2010

use the trace() function to confirm that variable is what you expect.