Load variables into Flash from other API (Javascript)
November 29, 2008
1. Add a video instance into the stage and name it to “my_movie” or anything u like as long as u’ll do the debugging later on.
In Frame 0, add these
//———————
// Create a NetConnection object
var my_nc:NetConnection = new NetConnection();
// Create a local streaming connection
my_nc.connect(null);
// Create a NetStream object and define an onStatus() function
var my_ns:NetStream = new NetStream(my_nc);
// Attach the NetStream video feed to the Video object
my_video.attachVideo(my_ns);
// Set the buffer time
my_ns.setBufferTime(5);
// Begin playing the FLV file
my_ns.play(”default_video.flv”);
//———————–
import flash.external.ExternalInterface;
ExternalInterface.addCallback(”asFunc”, this, asFunc);
function asFunc(str:String):Void {
in_ti.text = str;
my_ns.play(str);
}
//————–
In JAVASCRIPT
Just add a form or function javascript:MAKECALL(’your value’); for any JAVASCRIPT event/form; yes …. between the >head
*/script*
function thisMovie(movieName)
;
var isIE = navigator.appName.indexOf(”Microsoft”) != -1;
return (isIE) ? window[movieName] : document[movieName];
;
function makeCall(str) {
thisMovie(”extint”).asFunc(str);
;
More in Flash’s help
There’s more for next morning … too tired to think of another interface.
Maybank2u sucks one more time with the new layout design. The link to Online Prepaid is missing and I am lack of credit.
3AM .. and that’s it for the push to the target for this weekend. Huarrghhhh mata letih