Hi Guys,

I'm finally making the painful transition from AS2 to AS3. I am having difficult time getting javascript to send vars to AS3. I've pasted my AS and JS below. Can anyone tell if I am doing something wrong? I tried to follow every tutorial I googled but I just can't seem to make it work.



///// Actionscript 3.0 /////

package {
        import flash.display.Sprite;
        import flash.text.TextField;
        import flash.events.MouseEvent;
        import flash.external.ExternalInterface;
        import flash.events.Event;

        public class videoPlayer extends Sprite {
                public function videoPlayer():void {
                         var videoPath:String;
                         var videoImage:String;

                        ExternalInterface.addCallback("playVideo", playVideo);
                }
                public function playVideo(videoPath, videoImage):void {
                        var tf = new TextField();
                        tf.y = 100;
                        tf.x = 100;
                        tf.height = 40;
                        tf.background = true;
                        tf.backgroundColor = "0x33DD44";
                        addChild(tf);

                        tf.text = videoPath;
                }
        }
}



///// Javascript /////

function thisMovie(movieName) {
        if (navigator.appName.indexOf("Microsoft") != -1) {
                return window[movieName]
        } else {
                return document[movieName]
        }
 }
function playVideo(videoPath,videoImage){
        thisMovie('kokua_player').playVideo(videoPath,videoImage);
}
function initVideo() {
        playVideo('EarthDayRes1.flv','stillPreview.png');
 }



THANKS!

--
Carl Welch
http://www.carlwelch.com
http://www.jointjam.com
[EMAIL PROTECTED]
805.403.4819




_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to