Flash Actionscript -
This is my first time for an action code for Flash. I want to write a flash clip which acts as the guardian of another flash clip. I want to write the function in the original flash, and call that function in the hair flash clip. For example, I want to create an episode that sends the game score "submitscore.php" Parents are just a controller and the child is my game. I want to send the game score to the controller, then send it to my php file. Do you have any sample code or something to do? I really do not know what I want to be difficult or easy because it is my first time;) thanx than before
Var game: object; Send private functionPHP (E: CustomEvent): zero {var score: number = escor; // send it} // Load the game .SWF var ldr: loader = new loader (); AddChild; Ldr.contentLoaderInfo.addEventListener (event.complete, onload); Ldr.load (new URLRequest ("Game.swf")); Private Function Onload (E: Event): Zero {game = LoaderInfo (e.target). material; Game.addEventListener ("sendScore", sendToPHP); } //Game.as // whenever you want to send a score to php dispatchEvent (new CustomEvent ("SendScore", Score)), call it; / ** * Custom event. The event should be extended and its constructor should update the public * property score: Number and call super () with the first parameter * Feel free to ask if you have any doubt in implementing a custom event * * / < / Code>
Comments
Post a Comment