ActionScript 3.0 :: Argh. Parsing Information From Loaded XML?
Mar 25, 2009
I am trying to import data from a SVG but as i found out, SVG is essentially XML.I have loaded in the SVG file and managed to output this to the output window:
Code:
<svg:path style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 53.8125,53.21875 L 52.84375,53.4375 z" id="path2435"/>The information i want to extract from this the M and L values.
Code:
d="M 53.8125,53.21875 L 52.84375,53.4375" Firstly im not really sure how to shave off the rest of the garbage to leave me with the above.Then comes the issue of actually finding what i want to work with. I want to end up with an array of Point objects, So in this example, i would have 2 points in my array:
point1 = (53.8125) , (53.2187)
point2 = (52.8437) , (54.4375)
This seems hugely complicated so i was wondering if anyone can enlighten me? Do i need to use regular expressions for what i want to do and if so, do you have any tips?
View 1 Replies
Similar Posts:
Jun 11, 2007
Been creating a scroll bar for images. the issue is i cant seem to get sensible stop parameters for the ends of the scroll and scroll bar button. my formulae just wont tie in with the positions at extreme left and right of content/button movement.
The number of images scrolled in the scroller is set by a txt file and is currently at 16, but this is to be changeable. that bit is not an issue, just the scroll parameters. Oh and the Images are in an "images" folder - surprisingly!
[Code]...
View 1 Replies
Jul 7, 2007
I don't know if I'm using the correctly terminology but I've made a movie rater in flash for MySpace. The problem is it doesn't allow script access. The music players on MySpace load xml files through the embed statment.
Now, I've done the same thing using this:
[URL]
I know how to read xml files in actionscript (variable=moviedata.xml.firstchild.firstchild.node value; ) and all that good stuff. The problem is, I don't know how to read an xml file that has been loaded this way with out the actual load commands being in the swf itself.
View 5 Replies
Apr 25, 2006
I am loading in a bunch of text (and other data) from an XML file into Dynamic Text Fields on my stage via an XML.load call. Below is one example of one entry of my XML file:
PHP Code:
<stillDescriptions><text>Mack Trucks of North America came to us tothem create marketing m
[code].....
View 1 Replies
Mar 30, 2011
So I have an SWF that I've made and I need to appened some instructions to the beginning of the project. I figured the easiest way to do this was to make the animation in a separate SWF then import it to the start of the first one. My problem is that I can't find a reliable way to tell when the first SWF is finished playing. I've googled the heck out of this but I can't seem to find anything that works. For some bizarre reason, no matter what I do the program seems to think that the external SWF only has 2 frames, if I put an ENTER_FRAME listener and trace externalSWF.currentFrame I get "1, 1, 2, 2, 2, 2, 2, 2..." My code looks something like this.
[Code]...
Also, for the record, the external SWF plays properly when I add it as a child. The problem is removing it from the stage when it's done playing. It's interactive so I can't just do a frame count.Edit: So I tried doing a getQualifiedClassName() call on extSwf and I got "Instructions_fla::MainTimeline_Preloader_" which could explain the frame discrepency. How can I have access to the actual timeline?
View 2 Replies
Jul 16, 2007
I'm building a product page, here's the setup:
[URL]
On the index.swf is the main navigation that'll open swf's for the different categories. Those products.swf fills with products via php. This is the working code for products.swf:
ActionScript Code:
var t = "";
var cat:String = "products";
[code].....
Now my main issue is, I can't get the product_info.swf right. The problem is I don't know how you can define the products within the products.swf with a name, so you can tell which product you should display in the product_info.swf
View 5 Replies
Feb 25, 2009
how to retrieve information about size (in pixels) of loaded FLV file? Video object returns 2 pairs of parameters (width,height) which are useless because returns always parameters passed in constructor of Video() object. Another pair is (videoWidth,videoHeight) which is always (0,0). I gave up...
I need this information to scale proportionally video clip to size of area designed to display this video.
View 3 Replies
Jul 5, 2009
I'm kinda noobish when it comes to getting information from XML information sent to my flash file from the socket server. OK so for example the server sends me this:
[Code]...
I want to get the name of the user and the X and Y position! Is there a way I can get this information without a load of fuss from functions and other junk remember im kinda noobish.
View 1 Replies
Feb 11, 2011
I want to build a program built around my pc specs. Is there a way to access such information as how much ram I have or how much cpu usage is being consumed, etc.?
View 2 Replies
Apr 13, 2009
I have a couple of questions that I hope someone can answer. I have this ActionScript that reads the XML file into the flash movie. The poblem is this: The XML is in this format:
<listitem name="TEST" url="rtmp://000.000.000.000/">
<stream len="-1" name="Test" start="0"/>
<group name="Testing"/>
</listitem>
[code]....
View 1 Replies
Feb 26, 2010
i get a syntax error when everything seems to be in the right place, out..home.swf
PHP Code:
stop();
var xmlLoader:URLLoader = new URLLoader();
[code]........
View 8 Replies
Oct 5, 2010
I want to get id from this [URL] get this id in as3 and use this id in xml and show the message in text field.
[Code]...
View 4 Replies
Sep 26, 2008
This is my first day to try and use XML to display dynamic text in Flash. My skillset is weak with AS3 and Flash, but I found some tutorials online and I have managed to successfully display the first record in mytest.swf. However I also seem to have all records displaying in each dynamic text box as well. My loop isn't stopping after each record. It's reading everything. And dumping the results into each text field.
I need to only display each record individually. Once I accomplish that, I will need to include some form of navigation. Lets say buttons that perform a NEXT, PREVIOUS, LAST, FIRST type function. Then lastly, I'll need to include some type of search navigation option by item number. I assume that I'd have to have a second screen that links to my primary results screen with an input form for the item number.
[Code]...
View 3 Replies
Jun 30, 2009
I am accessing an xml document in actionscript, I know flash can see the xml as I am tracing it but when I add the .text() funtion to my trace to strip out the tags by trace doesn't see anything.
function LoadXML(e:Event):void {xmlData = new XML(e.target.data);ParseXML(xmlData);}function ParseXML(thexmlInput:XML):void {
trace("XML Output");trace("------------------------");trace(thexmlInput.wrapper.page);
[code].....
View 2 Replies
Sep 28, 2009
I am attempting to parse some weather information from the Yahoo weather RSS feed.This is a typical XML node;
<description>Yahoo! Weather for Palm Springs, CA</description>
I used the typical XML parsing code in as2;
var text1 = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
txt1.text = text1;
I was doing pretty good until I reached a node that was formatted thus;
<yweather:forecast day="Mon" date="28 Sep 2009" low="74" high="103" text="Sunny" code="32" />
This text traced a value of undefined.I have tried to research this and so far all I have been able to find out, is that this is a XML namespace and is very easily handled in as3. Unfortunately I have to use as2.How do I parse out this information into a dyamic text fields?
View 2 Replies
Aug 26, 2010
I am passing a XML document form the Java to Flex using Remote Object.[code]...
View 1 Replies
Sep 29, 2010
I'm trying to make a banner which the user can edit his Preferences in a xml file. My xml file looks like below.[code]that means image 1 has three textboxes with fontsize: 14,18,30.now i've the following problem.as you can see i've get function from my billboardData_array i want to call this get function in other classes to get the correct data i need. [code]this function returns the last fontsize but i need to loop through it to display text on the stage.
View 1 Replies
Dec 21, 2010
I am trying to parse out the nodeName but nothing was return, what is wrong with my script?
[Code]...
View 1 Replies
Jan 19, 2011
i have this response from a socket server:
[DataEvent type="data" bubbles=false
cancelable=false eventPhase=2
data="Segunda vez"]
How can i parse this info?, for example if i want the data value.
View 1 Replies
Jan 12, 2012
I have an xml file and im putting this xml file in an XML object
var receivedXML:XML
In some function, I have:
var xmlList:XMLList = new XMLList();
xmlList = receivedXML.some.attributes.here;
object.functionDoStuff = xmlList;
The function functionDoStuff takes xmlList as its argument:
function functionDoStuff(xmlList:XMLList) {}
When does receivedXML get parsed, is it when we assign it to xmlList, or is it when it gets used in the next instruction by the function functionDoStuff?
View 1 Replies
Jan 25, 2011
If I use the following XML it does not output anything. Please help me to find what is the issue.
PHP Code:
[Code]...
View 2 Replies
Mar 11, 2011
I have Visual studio with AS and Flex 4 installed into it. Can someone provide me with simple sample code and a simple xml file (can just be like a=8083&b=8873) and grabbing the data for a and b and putting this into 2 different arrays of size 1 (since its simple).
View 1 Replies
Oct 14, 2004
Is it possible to parse variables between different swf-files? Say that Ive got this main movie to which I load an external swf-file. Can I then send data from this externally loaded swf to the main movie?
View 1 Replies
May 25, 2005
I`m trying to load different texts from one XML file into my pre-defined areas. It works with one text....I gt to my frame where the as below is and the text gets loaded. BUT how do I need to proceed if I want to go to another frame and have a different text loaded from the same XML file?
Code:
function loadXML(loaded) {
if (loaded) {
_root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
[Code]....
View 4 Replies
Jun 27, 2005
i just created an image gallery. i used the kirupa tutorial as a rough guideline, so i changed up a few things. it works fine. im wanting to use the xml file as a config file, but that part is not working.
heres my xml code:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<gallery textcolor="0x999999" bgcolor="0x000000">
<image url="http://home.comcast.net/~urtalkinstupid/image1.jpg" caption="OMG! dude has peanut butter on his nose!"/>
<image url="http://home.comcast.net/~urtalkinstupid/image2.jpg" caption="he wouldnt be quiet; we had to do it."/>
[code]....
View 3 Replies
May 2, 2008
i've been using the gotoandlearn.com mp3player when wanting to provide music in flash, the other day i decided to rewrite into a class. my textfield returns "undefined", which is frustrating because i know the nodes are being parsed into the loadXML(); method. the problem i'm having seems to be in the playSong() method, the sa Array hasn't retained the information that had been parsed into it when the loadXML(); method is initialized.below is the class i'm working with;ve been trying to figure it out for a couple of days now, this is a last resort.......
class actionscript.mp3Player extends MovieClip {
public var s:Sound;// Setup sound object
public var sa:Array;// Array of songs
[code].....
View 2 Replies
Mar 30, 2009
I'm trying to find a way to parse out some numbers from a potential string. Basically, I'm making a financial-based calculator, and the user could input something like
$45,509.30
and I'm trying to figure out how to extract everything but the period so I'm left with
45509.30
I found this help from Senocular: [URL]
But unfortunately, it's AS1 and I can't get it to work with my code...t
View 1 Replies
May 20, 2009
I have a 6mb XML file, resetting my script timout in CS4 doesn't help. (it does have some unnecesarry HTML in it I could probably do away with, but that would be the wrong direction I think)I can't even trace it.I am loading it into an :XML object and trying to work with it, but all to no avail.
Here is my Class:
Code:
/**
User class
author: Manaburn
[code]...
The for each loop wont iterate for some reason, but the for loop will, then again, it always crashes me with:
Code:
Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
(which as I stated above I reset, but as this is a .as file, I don't think it allows that.)
View 12 Replies
Oct 7, 2009
I'm having a little problem storing something like this
"this is a new line"
into a string value from an xml file but then when i want to go apply it to a dynamic text box it loses the new line character and actually displays
"this is a new line"
instead of
"this is a new line"
View 9 Replies
Oct 21, 2009
Ran into some problems when a client asked me to use the xml that is created from an admin where the user can format the text as she or he wants it. With bold, italic, insert link and so on. Doing all that in a frame in the browser that is. As you would guess from a proper admin tool more or less.
[Code]...
View 8 Replies