conagraman
asked on
fire PHP function in AS3/flash
ok i have a php function which creates thumbnails. i want to execute this function from my swf as3.
i have some code that works now but it only works the first time after the swf has been published. i'm guessing because it worked and is loaded but i cant get it to unload /work again.
the as3 fires in a button listener. what i need is to be able to hit that button as many times as needed. i am new to both as3 and php so take it easy on me lol i am stuck please help
my as3 code is
function goURL() {
var request:URLRequest = new URLRequest("myfile.php");
var loader:URLLoader = new URLLoader();
loader.load(request);
i have some code that works now but it only works the first time after the swf has been published. i'm guessing because it worked and is loaded but i cant get it to unload /work again.
the as3 fires in a button listener. what i need is to be able to hit that button as many times as needed. i am new to both as3 and php so take it easy on me lol i am stuck please help
my as3 code is
function goURL() {
var request:URLRequest = new URLRequest("myfile.php");
var loader:URLLoader = new URLLoader();
loader.load(request);
ASKER
thanks for the comment : )
but i have already came that far.
i wish it was that simple
but i have already came that far.
i wish it was that simple
Ok, no problem. I didn't realize you came that far. Your example code looked incomplete and was missing proper syntax.
Good luck.
Good luck.
ASKER
i think i need eaither another way of loading/opening the php file or the solution will comefrom the loader class or urlrequest class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you're happy that your problem is resolved please close your question.
if you require further assitance please post your full code to show how you're handling the php return values. etc
the php code might help as well.
if you require further assitance please post your full code to show how you're handling the php return values. etc
the php code might help as well.
ASKER
blue genie
i think i was just making some rookie mistakes. part of the learning process i guess. as far as closing the q i thought i did but i guess it didnt take. ill try again. thanks
i think i was just making some rookie mistakes. part of the learning process i guess. as far as closing the q i thought i did but i guess it didnt take. ill try again. thanks
np. glad you came right.
ASKER
please close the q. i was able to gain a better understanding of what i was doing and was able to use the urlloader in the correct way. thanks to all who tried to help.
Add an event listener to button to call the function when it is clicked:
your_button.addEventListen
In your function throw the event:MouseEvent in it:
function goURL(event:MouseEvent)
{
var request:URLRequest = new URLRequest("myfile.php");
var loader:URLLoader = new URLLoader();
loader.load(request);
}
Hopefully this will get you heading in the right direction.