|
-
New to Arrays... help please!
Hey there... was wondering if anyone could help me on building an array.
I've looked into tutorials and stuff but they all do different things and none are what i'm looking for.
Here's what i'm looking for: There will be an Array with a list of quotes, and a MC containing a dynamic text box. The MC animates, and when it's done animating, the quote inside the dynamic text box is changed to the next quote. It continues animate, then switch, animate, switch, and so on until it restarts the list (array). Can anyone help me?
Thanks alot!
-Andrew
-
Re: New to Arrays... help please!
quoteArray=["quote1","quote2","quote3","quote4","quote5"]
i=0
on the end of animation (when you have to change quote):
textVar = quoteArray[i]
i++
if(i==quoteArray.length) {
i=0
}
-
...and the law won
Is there anyway instead of quotes, to import data from a database to be displayed and if so would I just import the url?
-
you'll have to use PHP to import data from database... instead of that you can import quotes from TXT file...
-
...and the law won
DuJo,
Are the 'quotes' being pulled from an external file (.txt)? If not how would you set that up?
Man I don't know how some of you guys know how to do all of this.
-
you can write this in TXT file..
quotes=quote1
quote2
quote3
quote4
quote5
and then write this in frame action...
loadQuotes = new LoadVars()
loadQuotes.onLoad = function() {
_root.quoteArray = this.quotes.split("\n")
}
loadQuotes("name_of_txt_file.txt")
and you'll get this...
quoteArray=["quote1","quote2","quote3","quote4","quote5"]
-
...and the law won
Dujo you rock
Thanks for replying its getting harder to get good help these days.
My text is scrolling however it is displaying '_level0.quoteArray.textVar' instead of any of my quotes. Any ideas?
-
...and the law won
Also
Does this string need to be edited 'this.quotes.split("\n")' what is the .split and "\n" for?
-
Re: Dujo you rock
loadQuotes = new LoadVars()
loadQuotes.onLoad = function() {
_root.textVar = this.quotes
}
loadQuotes("name_of_txt_file.txt")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|