Groups | Blog | Home
all groups > flash data integration > december 2005 >

flash data integration : Linking data, searching data, and format the data file


CobraC081375
12/30/2005 3:07:37 AM
I'm sorta new to flash and integrating data and components...I'm usu. an
interface designer.

I'm trying to link a combo box to a file doesn't matter preferably a
searchable txt file, then when submitting the search the output goes to another
txt box located in the picture i'm hosting....then making the output clickable
so when clicked another output goes to the address bar....this seems kinda
wierd but i need to know what direction or how to link all this together.



http://home.comcast.net/TEST.fla
Motion Maker
1/1/2006 5:28:27 PM
You would need decide which Flash Actionscript classes depending on your
needs.

This can include:

1. LoadVars AS class. To fetch URL formatted data from a server script that
in turn gets the data from a server file or database.
2. XML AS class. To fetch XML formatted data from a server script that in
turn gets the data from a server file or database.
3. SharedObject AS class to fetch Object AS class data from the user's
computer that you probably also wrote there. This is the equivalent to
cookies only contained in Flash.
4. FlashVars parameter of the OBJECT and EMBED tages. Usually a server side
script formats part of the OBJECT and EMBED tag to provide data from a
server file or database. The variables named in the FlashVars parameter are
then available on the root timeline of the Movie at the first frame.

Once the data is retrieved from these sources you can then addItems to the
combo box which usually entail a loop but really depends on the structure of
the data you have.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
I'm sorta new to flash and integrating data and components...I'm usu. an
interface designer.

I'm trying to link a combo box to a file doesn't matter preferably a
searchable txt file, then when submitting the search the output goes to
another
txt box located in the picture i'm hosting....then making the output
clickable
so when clicked another output goes to the address bar....this seems kinda
wierd but i need to know what direction or how to link all this together.



http://home.comcast.net/TEST.fla

CobraC081375
1/2/2006 6:51:48 PM
Motion Maker
1/2/2006 6:57:04 PM
You can read text files with either URL vars or XML data but you still need
to use the LoadVars and XML Actionscript classes respectively to do so.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Can I just have it read from a formatted html or xml data?

Motion Maker
1/5/2006 4:54:26 PM
For LoadVars the text file would be one line just as it appears for a URL
query string. A generic layout example (it is one continuous line):

var1=ABC&var2=123&var3=Hello World&var4=<b>blah blah blah</b><br>Yadda yadda

Where you would substitute var1, var2 with meaningful names that LoadVars
will automatically parse into Flash variables for you to use. Ex:
price=123&name=ABC

For XML again on one line a generic layout example (it is one continuous
line):

<?xml version="1.0"
encoding="iso-8859-1"?><datapacket><nodeName1>ABC</nodeName1><nodeName2>123</nodeName2><nodeName3>Hello
World</nodeName3><nodeName4><b>blah blah blah</b><br>Yadda
yadda</nodeName4></datapacket>

Again your nodeNames would be more meaningful to you ex:
<price>123</price><name>ABC</name>. Flash XML then provides XML methods to
parse out the data into Flash variables -- you need to do that.


In both cases no whitespace (tabs, spaces and returns) other than in the
data values such as the space in Hello World.

Normally yu use word wrap in editor to help in editing.

If you use server scripting then you can use separate lines in the script
code and it will not add whitespace unless you add it.


Although I do not have a simple example with a plain text file, here is a
simple LoadVars example with PHP. The Flash side is the same.

http://www.hosfordusa.com/ClickSystems/courses/flash/examples/LoadVars/LoadVarsEx01.php

And this one before you hit the register button that demonstrates the
LoadVars populating Flash UI components. Again it is using PHP but you can
use a plain text file instead with the above format.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
so if i use those and can get it to connect via a txt file how do i format
the txt file and can i have a function to search that txt file?...dont
forget i am noobish when it comes to all this.

CobraC081375
1/5/2006 8:26:58 PM
AddThis Social Bookmark Button