-
communicating with external actionscript (as2, Flash 8)
I'm making a document with Flash 8 professional, and I want to display a lot of text from strings that I make in actionscript. The user would type in number in an input box and a chart would be displayed with data (numbers and words) based on what was typed in the input box. The numbers put into the input box could range from 1-200, so to avoid long a long load time, I want to put the data on separate actionscript files, one for each possible input number, that would load when the "submit" button is clicked. The flash document would then communicate with the actionscript files when a number is put in the input field and the "submit" button is pushed. Is there a way to do this? If so, what is the best way to go about it?
I think the code would be something like this, but I'm not sure:
Code:
_root.myButton.onRelease = function() {
if(myInputField.text == "1") {
//include the actionscript document for variable set #1 (I would give the url?)
}
if(myInputField.text == "2" {
//include the actionscript document for variable set #2 (Again, I would give the url)
}
//etc...
}
-
Hi,
there is no such thing as a conditional include, since all of the AS is compiled into the swf at publish time. You should consider retrieving just the required data from a server when requested
Musicman
-
What does that process involve? I get the feeling I'll have to step outside my comfort zone and do something other than actionscript...
-
Hi,
the common variant is a server script that is given the input number as an argument, another variant would be one file on the server per allowed value.
In either case your movie would use a loadvars type interaction with the server
Musicman
Tags for this Thread
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
|