logo-dw

Go Back   Dreamweaver Club Forums > Graphic Design > Flash
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-23-2010, 12:37 AM   #1
andy1212
 
Join Date: Sep 2010
Posts: 17
Default .swf sound not playing in dreamweaver

I have a .swf that contains an imported .mp3 sound file in it and I've embedded the .swf into dreamweaver. I tried loading the sound externally in my flash file and no luck with that either. BTW I'm using flash and dreamweaver cs4. When I test the .swf in flash the sound works perfectly(even when i was loading the sound externally), but when I test the DW page in FF or IE the sound doesn't work, just the animation. When I also upload the page and necessary files to my host the sound doesn't play when I go to the page and click the play button, just the animation. I'm using the sound class for flash by the way. The code that I used for the sound clip is this,

Code:
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var lastPosition:Number = 0;
var myTransform:SoundTransform = new SoundTransform();
mySound.load(new URLRequest("introaudio.mp3"));
myChannel = mySound.play();

var myTransform2 = new SoundTransform();
var myCurrentVolume:Number = 1;

myTransform2.volume = 1;
myChannel.soundTransform = myTransform2;

plusminus.plus_btn.addEventListener(MouseEvent.CLICK, volUp);
function volUp(e:MouseEvent):void
    {
      myTransform2.volume += .1;
      myCurrentVolume += .1;
      if(myTransform2.volume <= 2)
      {
      myChannel.soundTransform = myTransform2;
      }
      else
      {
      myTransform2.volume = 2;
      myCurrentVolume =2;
      myChannel.soundTransform = myTransform2;
      }
    }

    plusminus.minus_btn.addEventListener(MouseEvent.CLICK, volDown);
    function volDown(e:MouseEvent):void
    {
      myTransform2.volume -= .1;
      myCurrentVolume -=.1;
      if(myTransform2.volume >= 0)
      {
      myChannel.soundTransform = myTransform2;
      }
      else
      {
      myTransform2.volume = 0;
      myCurrentVolume =0;
      myChannel.soundTransform = myTransform2;
      }
    }

pause2_btn.addEventListener(MouseEvent.CLICK, onClickPause);

function onClickPause(e:MouseEvent):void{
lastPosition = myChannel.position;
myChannel.stop();
play2_btn.addEventListener(MouseEvent.CLICK, onClickPlay);
}

function onClickPlay(e:MouseEvent):void{
myChannel = mySound.play(lastPosition);
play2_btn.removeEventListener(MouseEvent.CLICK, onClickPlay);
myTransform2.volume =myCurrentVolume;
myChannel.soundTransform = myTransform2;
}

play2_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler4);

function mouseDownHandler4(event:MouseEvent):void {
      play();
}

pause2_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler5);

function mouseDownHandler5(event:MouseEvent):void {
      stop();
}
and this is the code that is used to insert the .swf file into my dreamweaver web page.

Code:
<div id="middle" align="center">
  <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1000" height="400">
    <param name="movie" value="../flash/wdnintro.swf" />
    <param name="quality" value="high" />
    <param name="wmode" value="opaque" />
    <param name="swfversion" value="6.0.65.0" />
    <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you donít want users to see the prompt. -->
    <param name="expressinstall" value="../Scripts/expressInstall.swf" />
    <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="../flash/wdnintro.swf" width="1000" height="400">
      <!--<![endif]-->
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <param name="expressinstall" value="../Scripts/expressInstall.swf" />
      <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
      <div>
        <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
        <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
      </div>
      <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
  </object>
</div>
andy1212 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:20 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com