Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    led
    led is offline
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer flash as3 player not working in IE

    I am trying to create a simple audio flash player, that calls a js function on click, it works perfectly in all browsers, except IE. i cant figure out what seems to be the problem! the player works fine but i cant get it to call js in IE

    here is html:
    Code:
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" >
        <head>
        <meta http-equiv="Content-Type" content="text/html;  charset=ISO-8859-1" />
        <title>player</title>
        </head>
        <body >
    
        <![if !IE]>
        <object type="application/x-shockwave-flash" classid="bla" width="18" height="30"               id="myFlashMovie"> 
    <param name="wmode" value="opaque" />   
    <param name="FlashVars" value="mp3.mp3" />
    <embed type="application/x-shockwave-flash" width="18" height="30"      src="player%2Eswf" id="flashObj" FlashVars="audioTrackPath=mp3%2Emp3" />
        </object>
        <![endif]>
    
        <!--[if IE]>
        <object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-  96b8-444553540000" width="18" height="30" id="movie" allowScriptAccess="sameDomain" >
        <PARAM NAME="movie" id="movie" value="player%2Eswf?audioTrackPath=mp3%2Emp3"/>
    <PARAM NAME="FlashVars" value="mp3%2Emp3" />
    <PARAM NAME="allowScriptAccess" value="always" />   
        <![endif]-->    
    
    
        <script type="text/javascript">
        alert("Hello World");
        </script>
        <noscript>Sorry, your browser does not support JavaScript!</noscript>
    
        <script type="text/javascript">
        function countdown() {
                alert("countdown");
                    }
        </script>   
        </body>
        </html>
    and here is as:
    Code:
        import flash.media.Sound;
        import flash.media.SoundLoaderContext;
        import flash.net.URLRequest;
        flash.system.Security.allowDomain("http://localhost");
    
    
    
        var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
        var audioTrackPath:String = String(paramObj['audioTrackPath']);
    
    
        stop();
        play_btn.addEventListener(MouseEvent.CLICK, playSound);
    
        function playSound (e:MouseEvent):void{
    try {
        ExternalInterface.call("countdown");
        } catch(e:Error) {
        trace(e)
        }
    //ExternalInterface.call("countdown");
    gotoAndStop(2);
    var soundClip:Sound; 
    var soundChannel:SoundChannel = new SoundChannel();
    
    function init() {
        soundClip = new Sound();
        soundClip.addEventListener(ProgressEvent.PROGRESS, soundLoading);
        soundClip.addEventListener(Event.COMPLETE, soundLoaded);
    
        var req:URLRequest = new URLRequest(audioTrackPath);
        var context:SoundLoaderContext = new SoundLoaderContext(1000, true);
        soundClip.load(req,context);
        //soundChannel = soundClip.play();
    }
    
    init();
    
    function soundLoaded(e:Event) {
        soundChannel = soundClip.play();
    
    }
    
    function soundLoading(e:ProgressEvent) {
    // preloader information goes here
        trace(String(int(100*e.bytesLoaded / e.bytesTotal))+"%");
    }
    
    stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
        function stopSound (e:MouseEvent):void{
        gotoAndStop(1);
        soundChannel.stop();
    }   
    }
    i have been googleing for 3 days now, but i cant seem to find an answer...

  • #2
    New Coder
    Join Date
    Dec 2011
    Location
    San Francisco, CA
    Posts
    24
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Do you have an actual URL to show us so we can go look at it?

    Also.. what version of IE?

    And does this version of IE show you any javascript warnings?

    It's probably something trivial, like a variable definition, or one of those <![if !IE]> statements.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Replace all %2E with .
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •