Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-09-2002, 08:48 AM   #1
ralph II
Registered User
 
Join Date: Jul 2002
Posts: 19
Default putting loaded content in array

i'm building a site where all of its content is loaded in by an external php scripts and a mySQL database. My question is, how can i put all that data in arrays. when i use loadVariables i get something like:

title0=blabla&text0=this is my first text&title1=blabla2&text1=this is my second text&title2=blabla etc.

what i want to do now is make some sort of loop that puts this in arrays like

title[0] = "blabla";
title[1] = "blabla2";
...

and

text[0] = "this is my first text";
text[1] = "this is my second text";
...


or do i really have to learn XML now?
ralph II is offline   Reply With Quote
Old 07-09-2002, 01:22 PM   #2
ralph II
Registered User
 
Join Date: Jul 2002
Posts: 19
Default

anyone?
ralph II is offline   Reply With Quote
Old 07-09-2002, 02:16 PM   #3
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

try it this way:
textfile:
Code:
titles=blabla,blabla2,blablabb&text=first text,second text,third text&
flash code
ActionScript Code:
//once the file has been loaded:    var myTitles=new Array();    var myText=new Array();    myTitles=titles.split(",");    myText=text.split(",");    //NOTE: text is prolly NOT a good variable name to use.

also look in the library here or goto [PROTO]type and find brandon hall's re-write of the string object, it will really speed things up for the split function - especially if you have really big arrays.
__________________
tg
---
what the hell was i thinking?
tg 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
putting an mc entirely made of dynamic content into a root level scroll pane SCook Components 1 11-29-2004 10:05 PM
Check array content for datatype ZitZo ActionScript 2.0 2 11-19-2004 08:49 PM
trouble with variable getting lost whoo Simple Stuff (Newbies) 2 08-07-2004 05:52 PM
Need help with 'next' / 'prev' buttons when traversing an array asWarrior ActionScript 1.0 (and below) 2 04-08-2004 03:22 PM
Scrollbar not working with externally loaded content defrag79 Components 1 03-23-2004 07:55 PM


All times are GMT. The time now is 07:22 PM.

///
Follow actionscriptorg on Twitter

 


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