Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
budd101 #1
php to flash
I have a dynamic text instance in Flash named dynamic_txt and I want it to
display information from a php file. What command allows me to do this? Here
is the code:
PHP
<?php
print "dynamo_txt=DYNAMIC";
?>
ActionScript (2.0)
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if (success) {
//HERE IS WHERE I WANT THE COMMAND THAT WILL ALLOW DYNAMO_TXT TO DISPLAY THE
STRING //FROM THE PHP FILE
};
my_lv.load("cars.php");
budd101 Guest
-
Flash player not working on some websites & have foundRegestry keys of older Flash players.
Hi, like many people here I have problems seeing flash content on some websites but other websites work fine. I also found that YOUTUBE works... -
Flash player installed, but every site flash playerrequired for asks to install not working at all
Hi all, wondering if someone would be kind enough to help me, PLEASE lol Flash player asks to be installed everytime I go onto any site that... -
Javascript news ticker + Flash = shaking Flash inFirefox?
I'm moving content (which I didn't develop) from an old site to my new design. I've run across a strange issue where a javascript menu appears to be... -
Calling on the Flash gurus!! How do I bring in a multi-page PDF into Flash?
Hello, I think this may be new territory, well for me at least. I am trying to IMPORT a cable drawing package (PDF with over a hundred pages)... -
convert all flash site to both flash and no flash
a friend has a site that is done with all flash. they asked me to help make it readable by more browsers. could some belly point me in the right... -
MYSCREENNAMEISUNAVAILABLE #2
Re: php to flash
Read my threads - you use LoadVars and put value-pairs into an array.
Unfortunately, it was answered in AS 1.0/2.0 forum, not here so perhaps you
didn't find it.
//sqlcache
/* fyi you can always create some valid test data locally by doing something
like this:
var mytest:LoadVars=new LoadVars();
mytest.keyword10="keyword1"
mytest.keyword11="organelle"
mytest.keyword12="photosynthesis"
mytest.keyword13="digestion"
mytest.keyword14=""
mytest.keyword15=""
trace(mytest.toString())
*/
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function (success:Boolean):Void {
if (success) {
//assuming _global.keywords is already defined as an array:
//assuming _global.keywords might already have some keywords in it (otherwise
this could be simpler)
//create a temporary array:
var tmpkeywords:Array =[];
// Iterate over properties in my_lv
for (var prop in my_lv) {
if (typeof(my_lv[prop])=="string"){
tmpkeywords.push(my_lv[prop]);
}
}
trace("loaded in this order:"+tmpkeywords); //it is reversed, so:
tmpkeywords.reverse(); //turn it around
trace("reversed:"+tmpkeywords);
//now assuming that the _global.keywords is already an array with some
words... and we want to
//add to the end:
//the following 'function.apply' method lets the 'push' method take the
elements of tempwords as an array an adds them individually
_global.keywords.push.apply(_global.keywords,tmpke ywords);
trace("global keywords now has:"+_global.keywords)
} else {
trace("Unable to load external file.");
}
}
//make _global.keywords an array for testing:
_global.keywords=["hello","world"];
trace("global keywords starts with:"+_global.keywords)
my_lv.load("sqlcache.txt");
//sqlcache.txt
GWD
User is offline
View Profile
Senior Member Posts: 1927
Joined: 06/24/2002
Send Private Message
03/11/2008 05:30:13 AM
Reply | Quote | Top | Bottom
You wouldn't usually want to or need to load the same data in twice.
I checked the link to your swf and I couldn't see it attempting to load any
external data via http activity. So I don't think this code is running in your
full swf (or perhaps it's only after signing in etc?)
Also, LoadVars automatically calls its own decode method by default, so you do
not need to use 'decode' in the onLoad handler.
Here's something which might help. Hopefully the comments etc, explain a
little bit. The function.apply line is probably the one that might be a little
difficult to comprehend. Its only there as a quick way to append the values to
the _global.keywords array (assuming that you want append them).
MYSCREENNAMEISUNAVAILABLE Guest
-
MYSCREENNAMEISUNAVAILABLE #3
Re: php to flash
any insight in going the other way - from flash to php? - see my other post
MYSCREENNAMEISUNAVAILABLE Guest



Reply With Quote

