i have been stuck on this thing for a while now and can't find the solution anywhere on the internet. I'm working on making a class file for the flash foru i just made and am stuck on the logging in part. The cript works and logs in the user, but i want to be able to know when the data has been loaded from php to flash.
I'm building an external class file that other developers can use to include a set of functions that essentially read and write data to MySQL via PHP.
The idea is that their AS2 script calls a method in my class which uses LoadVars to verify the data passed to it and write it to a database, and then it returns a value back to the AS.
I'm having a problem where the delay in waiting for OnLoad means that the calling AS function gets an undefined value back. i.e.
var returnValue=myClass.myMethod(params);
This (I assume) is setting returnValue instantly, despite the fact that LoadVars can take a little while to work.
What's the recommended/normal way to deal with this? I don't want to have to bring the OnLoad part of the process back into the developer's script, it would be nice to keep it all in the class. is there a way to make the calling script wait for a response?
I am using the following code to load my flash file, contact a php script and decide what frame to play based on the results. THat is all working fine, the problem is that when the animation starts from Frame 2 - gotoAndPlay(2) - it seems to repeat a few frames over and over until the whole animation is complete.
I have done some reading up and the enterFrame is called many times so I can understand why the problem is there but I don't know how to resolve it. The interesting thing is, when I just use gotoAndPlay(2) in the if loaded section, it all works fine. It's only when it's in the onLoad for the loadVars that causes it to break. Using: Flash CS5 and Actionscript 2.0
After using Google and these forums I've discovered that it's not possible to return a value directly from this function. However, I still need some kind of workaround, so here is my scenario:This function overrides the default onLoad function when I load up my XML. It works perfectly.
[Code].....
I want to somehow use this functionality to return the value of sContent when it is loaded, so I can use the line
PHP Code:
returnContent(x)
in conjunction with the following function
PHP Code:
function returnContent(Nume) { xmlContent.load(x);}
to return a string from the xml on an on load event.
I.e. - on mouseclick, a texfield.text variable is assigned to returnContent(x);
I just want a function to return true, but after a LoadVars.onLoad.event. Am I right in assuuming that the return in the onLoad = function below relates ONLY to that function? What I want is for the sendLockCheck()to return true depending on the if statement within the onLoad.
function sendLockCheck() { var lockCheckResult_lv:LoadVars = new LoadVars(); var lockCheckSend_lv:LoadVars = new LoadVars();[code].....
I have a URL Query String Generated Flash Site and I need this code so that when it can not find the swf typed it will return with an Error. Here's my code that I thinks should work.
I have a flash menu which is currently loading its contents via a ever-changing XML file... well this has always been a good thing and worked just fine... until the release of AOL 9.0, which for some reason causes the XML to stop loading.So I found a workaround for this... rather than calling "menu.xml" I have this sript called "proxy.asp" which loads the "menu.xml" file into it via some sort of crazy .asp tunneling and object creation. Here is the proxy.asp file::
Code: <%@ LANGUAGE=VBScript%> <% Response.Buffer=True Dim MyConnection, TheURL
[code]....
NOW...since I run in literally hundreds of websites I need it to be dynamic. Is there a way for me to use the sendAndLoad() in Flash to pass the "proxy.asp" file a couple variables that will return the XML as an XML Object back into Flash? I know it can return Strings, but I need to learn how to send 2 variables out - ID and progID - and then based on that I will have the "theURL" variable in the proxy.asp file load the appropriate menu.xml file. how do I setup a sendAndLoad() with the LoadVars() and return XML from the proxy.asp?
One of the moderators, could you've a look at this tutorial: [URL] it doesn't works with me, maybe because I've 2004 so if you change loadVars() into LoadVars() it should work
I am writting an image gallery that loads one intial xml file named galleries.xml.From this point each xml node loads a XMl file for that gallery that holds all the images.The problem arises in the fact that to do this I need a onload function within an onload function.Onload functions dont accept parameters so I can pass down the variable that shows what loop the gallery loop is on as I need that in the function that holds the images.
I'm having some troubles with the use of interface and inheritance in AS3. I've done lots of OOP in the past and what I'm trying to do seems obvious to me, but doesn't work in AS3. The question is : Is it possible to override a function that return an Object of class A, and make it return an Object of Class B which extends A ? It seems not to be possible, since I'm getting a signature error in Flash, when compiling. For example, the following set of class do not compile (the code in function definition doesn't matter):
I am loading an XML file and when I run a trace inside the onLoad event the results show.When I put the same trace outside that event, the trace returns undefined because it runs before the XML is Loaded.I don't know how to assign the results of the XML to a variable being used outside the XML unless I call that through another event.For example. I want to preload some images if the user has been to the movie before. I call XML which has the image array. But I can't tap into that array because my function is outside the XML Load event and my function is not tied to an event.
_parent.unit['bullet'+openbullet].onLoad = bulletload; function bulletload() { this.range = 5;[code]...
my mc.enterfame works but this doesn't. I think it's because it's on load and for this to be implemented it has to be called after load so how do i use it? I tried to call it on the original but it didn't work.
It seems that the onLoad method fires twice ?? I know the .load method has to come after the .onLoad function for the function to work but that doesn�t seem to be the problem in this case.
How do I send a variable from the url [URL] to an embedded swf in that php?In other words, how do I get the embedded swf to load the variable from the URL. It needs to pass it, which I'm trying to accomplish via Javascript.
Is there a way that I can run a function when it first loads, as if it wasn't inside of the function, but still be able to call that block of code as a function later on? For example if I did...
Code: someFunction(); function someFunction():void{ //do this }
It wouldn't work correctly.. I need it to do what is inside the function as if it wasn't in the function, which it loads, but also be able to call it again later on.
I am loading one xml file and onload (or onData) of this file I am calling another function but, this function is not getting called. What can be the issue? Can delegates be used here and how?
Here is the code for reference
Code: //path for _global.bookXML is defined already. _global.book_xml = new XML(); _global.book_xml.ignoreWhite = true;
I managed to load data from xml file (at last) and now I faced another problem. I can give value to a variable, but cannot use outside of onLoad function. Lemme show you what I mean:
The first trace(variable) command (inside the onLoad function) returns the correct value, but the second (out of onLoad) returns undefined. I need the values elsewhere, not in onLoad.
When I run the section.swf on its own, the onload function works, and the "doing stuff" code runs. But when I load it into main, this onload (within the section.swf, above) does not run.
load XML data (it parses automatically), parse through the XML tree and assign the values to an array of my choosing for access later in the movie. I can load the XML data, but the only time I can access the XML functions, i.e. XML.firstChild, or XML.getChildNodes(), is when I am within an XML. onLoad function.[code]Shouldn't I be able to call these XML function and properties from anywhere? not just within the XML.onLoad function? I look at other people's scripts and they do it, but I can't?I created a function that parses through the data and puts it into an array. And that works well if I say XMLdata.onLoad = my_array_funtion();But the problem is, if I do it that way I can't get the array out of the function. I can't return the value because the function is being called from an onLoad event and the return value of the function isn't assigned to a variable. So the array I create is worthless.And there is no way to call the function, and have the XML.functions, i.e. XML.firstChild, to work outside of an XML.onLoad event. Is there? Please tell me there is a way.I tried assigning the array to a global variable, but evidently you can't modify _globals within a function.Ultimately, I need this array because later in the script I use the data on the fly, and I want instant access to it.
my mc.enterfame works but this doesn't. I think it's because it's on load and for this to be implemented it has to be called after load so how do i use it? I tried to call it on the original but it didn't work.
I've been searching this problem for a while and have tried a number of solutions found on google but nothing has worked so far. I'm sure this is a common problem, but due to my lack of flash knowledge I can't logically work through it as I'm used to windows form development, it makes sense to me that the function could access the variables I have defined but they dissapear after the .onLoad event. Does anyone know the common solution to this problem? I want to be able to pass the xml details into the local variables so I can pass on the details into a dynamic text field when movies are hovered over etc.
Because the swf_loader are mp3 player and if i change page wihout having press the stop button first the music is still playing. I have try to just add swf_loader.unloadMovie(); on every other keyframe but it doesnt work. i guess i have to find out where this swf_loader exist/is included right?
I've been sitting here for the last 2 hours trying to figure this one out.I have an empty movieclip on stage, and I'm loading external images in it using loadMovie()The problem is as following; I want it to resize when the image has fully loaded.I've been googling and googling non-stop, but found nothing that works.
I want to load a function/sound to play ONLY on the first load.eg/I have four pages, one page has a sound that loads every time I click back to that page. Is there a way to make it only load the first time that page is loaded?