FORUMS: list search recent posts

mysql > data>php>xml>flash question please

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ryan Summey
mysql > data>php>xml>flash question please
on Jun 28, 2008 at 2:07:47 am

im making flash thats going to show events for the bars/clubs around the area i have

id, bar, time_date, info fields in mysql db

all is working great

http://www.wncnightlife.com/event.html

so basicly the php logs on grabs the mysql db then codes it into xml for flash to read...


my issue is i want it to be AS3 not 2 and anyway to convert my AS2 code to 3

this is the code

var theXML:XML = new XML ();
theXML.ignoreWhite = true;

theXML.onLoad = function() {
var nodes = this.firstChild.childNodes
for(i=0;i theList.addItem(nodes[i].firstChild.nodeValue,i);
}

}

theXML.load("http://www.wncnightlife.com/events.php");

thank you for your time

-summey


Return to posts index

Pieter Helsen
Re: mysql > data>php>xml>flash question please
on Jun 28, 2008 at 10:21:35 am

This should do it.

var loader:URLLoader = new URLLoader(); 
loader.addEventListener(Event.COMPLETE, loadXML);
loader.load(new URLRequest(“http://www.wncnightlife.com/events.php”));

function loadXML(e:Event):void
{
xml = new XML(e.target.data);
trace(xml);
}


Kind regards,
Pieter


Return to posts index

Ryan Summey
Re: mysql > data>php>xml>flash question please
on Jun 28, 2008 at 5:12:39 pm

Thank you for your response. I tried the code you gave me and it returned it with this

line 13 1120: Access of undefined property xml.
xml = new XML(e.target.data);

line 15 1120: Access of undefined property xml.
trace(xml);

thank you for your time

-summey



Return to posts index


Sher Ali
Re: mysql > data>php>xml>flash question please
on Jun 28, 2008 at 6:35:14 pm

that is because xml is declared anywhere. Either declare the xml at the top to make it accessible by all the code or inside the event handler. To make it accessible by all code you can do this:


var xml:XML = new XML();
xml.ignoreWhitespace = true;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadXML);


loader.load(new URLRequest("http://www.wncnightlife.com/events.php"));

function loadXML(e:Event):void

{
xml = new XML(e.target.data);
trace(xml);

}


BTW you should check this out:
http://www.flashden.net/item/dynamic-xml-events-calendar/12667?ref=SaafiDes...


Sher Ali
Flash & Flex Developer
website: http://www.webeyestudio.com
blog: http://www.kabulinteractive.com/blog
My FlashDen Portfolio


Return to posts index

Ryan Summey
Re: mysql > data>php>xml>flash question please
on Jun 28, 2008 at 7:12:50 pm

Thank you for the response!

i checked that link and yes that calender would be awesome but its 20 bucks hahah i don't have 20 bucks to spend on that haah i would love to create that. that was my first idea that i had but i was reading up on how to make a calender in flash and didnt find much.


i may suck it up and by that.... but whats the fun in tat i want to learn how to do that






Return to posts index

Ryan Summey
Re: mysql > data>php>xml>flash question please
on Jun 28, 2008 at 8:19:02 pm

well i just made you richer i got the event calendar you made :)

i love it its exactly what i need but i just sorta puts a downer on me i wanna learn how this thing works and not take the wasy away out ...


thanks for your time and good work im sure ill have questions about this

-Ryan



Return to posts index


Opeyemi Ogundimu
Re: mysql > data>php>xml>flash question please
on Apr 7, 2009 at 12:13:16 am

Hello Ryan,

I'm an intermediate flash user wanting know how it is possible to retrieve xml data and display it in Flash.

My problem is with the Actionscript 2.0. i have the following code

var theXML:XML = new XML ();
theXML.ignoreWhite = true;

theXML.onLoad = function() {
var nodes = this.firstChild.childNodes;
for(i=0;i<nodes.length;i++){
theList.addItem(nodes[i].firstChild.nodeValue,i);
}

}

theXML.load("../../../get_data.php");


but each time i run the movie nothing happens. No errors and no data. Please put me on track. All help would be muchly appreciated.

Yemi


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]