Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.23 / 5.00 3,881 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.93 / 5.00 4,634 ViewsThe problem is that I can't access the xml data within the mouse function!
how do I declare it for a button function?
function nexth(e:Event):void{
var myXML= new XML(e.target.data);
/*This Code Provide This Error:
ReferenceError: Error #1069: Property data not found on flash.display.SimpleButton and there is no default value.
at rooms_info/nexth()*/
.
.
.
also when I use: e.target.data rather than new XML it still give me the error when I use the code for this code!
how do I declare it for a button function if I am here?
location_txt.text="Location: " +e.target.data.ROOM[j].@LOC;
/*This Code Provide This Error:
ReferenceError: Error #1069: Property data not found on flash.display.SimpleButton and there is no default value.
at rooms_info/nexth()*/ The Mouse click causes a MouseEvent.
The Event has nothing to do with any xml whatsoever.
That's what the error says in clear English.
How to solve this:
Don't copy and paste code mindlessly. It doesn't make any sense to request data from a button.
Explain your goal. What is this xml? What is this button supposed to do?
E.target is the thing you clicked, and displayobjects don't have a data property. If you extended sprite and that class has a data property which holds the XML, then cast e.target, but I doubt this is the case since the code would work anyway.
At 11/6/13 11:48 AM, milchreis wrote: Explain your goal. What is this xml? What is this button supposed to do?
I need 2 things to declare
This variable:
var myXML = new XML(e.target.data);
to retrieve the data from the XML File Inside a mouse function
add my XML inside my textField when the button is pressed!
location_txt.text="Location: " + myXML.ROOM[j].@LOC;
I hope you understand what I want to achieve here!
At 11/6/13 11:53 AM, MSGhero wrote: E.target is the thing you clicked, and displayobjects don't have a data property. If you extended sprite and that class has a data property which holds the XML, then cast e.target, but I doubt this is the case since the code would work anyway.
could you explain that using code example >.>?
At 11/6/13 11:58 AM, A-Genius wrote: I hope you understand what I want to achieve here!
Tell us what you think e.target.data is. Is it a string? A class name? An XML object?
At 11/6/13 01:12 PM, MSGhero wrote:At 11/6/13 11:58 AM, A-Genius wrote: I hope you understand what I want to achieve here!Tell us what you think e.target.data is. Is it a string? A class name? An XML object?
the holder of XML data ? :P
At 11/6/13 01:38 PM, A-Genius wrote:At 11/6/13 01:12 PM, MSGhero wrote:the holder of XML data ? :PAt 11/6/13 11:58 AM, A-Genius wrote: I hope you understand what I want to achieve here!Tell us what you think e.target.data is. Is it a string? A class name? An XML object?
am I right?
because that what I meant when I used:
var myXML = new XML(e.target.data);
it seems that it only works in EventListener for the loader!
Are you loading an XML from some URL or do you have it embedded into the SWF using metatags in Flex/FlashDevelop?!!
At 11/6/13 01:59 PM, kkots wrote: Are you loading an XML from some URL or do you have it embedded into the SWF using metatags in Flex/FlashDevelop?!!
I am using URLLoader and my XML file Contain tags!
At 11/6/13 02:15 PM, A-Genius wrote: I am using URLLoader and my XML file Contain tags!
*BOOMHEADSHOT*
Adobe Flash Platform * Reading external XML documents
Documentation taken from the Official Adobe ActionScript 3.0 Documentation
At 11/6/13 02:20 PM, kkots wrote:At 11/6/13 02:15 PM, A-Genius wrote: I am using URLLoader and my XML file Contain tags!*BOOMHEADSHOT*
Adobe Flash Platform * Reading external XML documents
Documentation taken from the Official Adobe ActionScript 3.0 Documentation
That does not ignore the fact that I can't find the right code if it's inside mouse event! X.X
FIXED THE STUPID PROBLEM!!!!
var myXML= new XML(XMLLoader.data);
that's the correct code!