Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Remoting

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-08-2003, 03:13 PM   #1
Maxil
Registered User
 
Maxil's Avatar
 
Join Date: Feb 2003
Location: Rome
Posts: 1
Question Associative Array from external data

I need to know how i can create and fill an array of this kind via external source:

ActionScript Code:
myArray[0] = ["alfa",1,["subAlfa1","subAlfa2","subAlfa3"]]; myArray[1] = ["beta",1,["subBeta1","subBeta2","subBeta3"]]; ...

The source can be an external text file or dynamic data form ASP

Please, give me a code snippet!!

Thanks in advance, Maxil
Maxil is offline   Reply With Quote
Old 02-08-2003, 04:33 PM   #2
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

IMHO I would serialize it on the server with wddx. ASP can do it with a library so look it up on google. Get the wddx_mx.as file from macromedia's site,

http://www.macromedia.com/software/f...ds/components/



Load the data in and deserialize it and you are done. This is MX only

ActionScript Code:
#include "wddx_mx.as" myWDDX = new WDDX(); myXML = new XML(); myXML.load("yourscript.asp"); myXML.onLoad = function() {   retVal = myWDDX.deserialize(this); }


BAm now retVal holds your data structure. Try it you will be amazed.
freddycodes is offline   Reply With Quote
Old 02-08-2003, 07:02 PM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,881
Default

WoW.... Freddycodes always shows me something I have never heard of almost EVERYDAY, and I am MAD!!!

Distributed Data Exchange (WDDX) FAQ
here in case someone, like myself, need to know what WDDX is...
and much more information about WDDX right HERE...

Do I need to get the FMX Remoting MX Components installed to get that wddx_mx.as file, you have mentioned, freddycodes??? I don't see any other link on that page rather than the Remoting stuff...

Okay, Maxil... I have answered similar question yesterday and you might want to take a look at this thread and get the file that I have attached, testlv.zip, to see if this one helps you... If you go over the thread, you will know why and what that file does...

Good luck...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 02-08-2003, 07:33 PM   #4
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Firstly don't confuse remoting components with remoting. Flash remoting the beast that doesn't support php and costs an arm and a leg? No. The components whcih are just a set of actionscripts you can download from that page, yes. They are free and are not "Flash remoting"

I have stumbled across the greatest thing ever today. Using XMLSocket with PHP and wddx to create a real time data exchange. I will post more as soon as I whip up a sample and a PHP to access.
freddycodes is offline   Reply With Quote
Old 02-08-2003, 07:41 PM   #5
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,881
Default

Oh... I guess I haven't paid much attention to the naming... As you have suspected, I thought that Flash Remoting and Flash Remoting Components are the same thing... Hehe...

Downloading... Approximately 15 more minutes to download that 6MB file with 56k... Oh... I want my cable back... Sigh... Why did I move to this apartment???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 02-08-2003, 08:01 PM   #6
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

BTW if you want to know how to get started with PHP and wddx and Flash
http://www.actionscript.org/tutorial...thin_Flash_MX/
freddycodes is offline   Reply With Quote
Old 02-08-2003, 08:11 PM   #7
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

This is the same thing as the tutorial but its realtime through a socket connection.

http://www.irq11.com/~louie/freddySe...ddyServer.html

If you have a PHP binary running with --enable-wddx and --enable-sockets let me know and I will put up the source.

This one actually accesses a php class and returns data from it.
freddycodes is offline   Reply With Quote
Old 02-08-2003, 11:50 PM   #8
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,881
Default

Geez... There is no way I can consume that much information... That's just too much... I'll do some experiment when the project that I am currently doing is done... Thank you for the information...

Got a couple of questions though...
Quote:
If you have a PHP binary running with --enable-wddx and --enable-sockets let me know and I will put up the source.
What do you mean by that PHP binary thing??? I have downloaded and installed PHP 4.3.0 installer, which is EXE version, from the www.php.net and it has nothing to do with what you are saying, right??? You are talking about the case when I am running PHP on the Unix/Linux shell, right??? I have no idea what you meant by '--enable-wddx and --enable-sockets'... Hehehe...

The example you mentioned is kinda the same thing that I have seen from the Scripting forum...(I think jimburton started the thread...) One thing I am not quite getting is that, I think, I can create the same thing which calls MySQL database with PHP in Flash... Can you briefly go over the advantages of using WDDX rather than MySQL database???

Thank you...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 02-09-2003, 02:14 AM   #9
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Yes I mean compiling your own copy of php on unix. If you are windows, you simply uncomment the line in the php.ini that says
extension php_sockets.dll


Quote:
Can you briefly go over the advantages of using WDDX rather than MySQL database???
I am using a MySQL database as well. wddx is merely the transport to get the data back to flash.

The advantage is, its less work to write your php scripts as if you were doing regular html, then use those same scripts to deliver the same data back to flash.

Lets take the example of using regular xml in flash. You have to loop through the results to get the data you want in flash right? wddx, you run deserialize and it its there like magic.

Its hard for me to get it across in words, one my add, two I havea hard time communicating what I am thinking


The example above is using sockets, the difference is it passes the data across a socket instead of through http, like flash's xml and LoadVars, it uses XMLSocket.

Read that tutorial and try to set the same thing up on your machine, thats really the only way to understand it.
freddycodes is offline   Reply With Quote
Old 02-09-2003, 07:35 AM   #10
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,881
Default

Thank you for the kind answer, freddycodes...
Quote:
wddx, you run deserialize and it its there like magic.
Wow... This sounds fantastic... The only reason why I don't use XML in Flash much is that and if I can get rid of that... WoW...

I see lots of places I can utilize WDDX... I'll get onto it as soon as my project is done... I probably will have to bug you many many times though...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Associative arrays Mortimer Jazz ActionScript 2.0 23 05-12-2004 06:11 AM
loading an object from an array NateVeronica ActionScript 2.0 1 03-30-2004 11:53 PM


All times are GMT. The time now is 08:29 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.