I have a school project that needs to be done next week, and im bumping into a lot of problems in flash!
- I have a FLV video in my scene and when i go to another frame, it keeps playing. and when i come back to that frame, the video plays again (so there are 2 videos playing!). How can i stop the video from playing?
i tried to make a empty frame with no video and im using this code
Actionscript Code:
import flash.events.MouseEvent;
var music4:Sound = new Sound(new URLRequest("busy_bar.mp3"));
var sc6:SoundChannel = music4.play(0, int.MAX_VALUE);
deTrap.addEventListener(MouseEvent.CLICK, deTrapClick)
function deTrapClick (evt:MouseEvent)
{
gotoAndPlay(35);
sc6.stop();
tv.gotoAndStop(6);
}
thePaper.addEventListener(MouseEvent.CLICK, dePaper)
function dePaper(evt:MouseEvent)
{
gotoAndPlay(10);
sc6.stop();
tv.gotoAndStop(6);
}
but I keep getting this error:
Actionscript Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at entrance_fla::MainTimeline/dePaper()
- My other problem is with the sound
Im now using external mp3's to play my sound (so the mp3's are in the same map as my swf)
but i want to use internal so i dont have to have the mp3's within the same place as my swf.
i tried to put the sounds in my timeline, but then i get the same problem with the video(it plays in the next frame)
im using this code for the sound:
Actionscript Code:
import flash.events.MouseEvent;
stop();
var music1:Sound = new Sound(new URLRequest("city_ambience.mp3"));
var music3:Sound = new Sound(new URLRequest("helicopter_flyby.mp3"));
var sc2:SoundChannel = music1.play(0, int.MAX_VALUE);
var sc3:SoundChannel = music3.play(0, int.MAX_VALUE);
DoorOpen.addEventListener(MouseEvent.CLICK, DoorClick)
function DoorClick (evt:MouseEvent)
{
gotoAndPlay(20);
sc2.stop();
sc3.stop();
}
i really need help with this!
thanks in advance!