I'm trying to have the music on my site autoplay & I don't know the code to put into flash to have my music player automatically play. If anyone can help, it'd be much appreciated. Thank you.
www.gangsterpaintball.com/testt.html
Here's the code:
Code:package com.lynda.audio { import flash.display.*; import flash.events.*; import flash.geom.*; import flash.media.*; import flash.net.*; public class Player extends MovieClip { public var channel:SoundChannel; public var sound:Sound; public var resumeTime:Number = 0; public function Player() { play_mc.buttonMode = true; pause_mc.buttonMode = true; pause_mc.visible = false; play_mc.addEventListener(MouseEvent.CLICK, playSong); pause_mc.addEventListener(MouseEvent.CLICK, pauseSong); } public function playSong(event:MouseEvent = null):void { var soundFile:String = "Gangster1234.mp3"; if(channel) { channel.stop(); } sound = new Sound(); sound.load(new URLRequest(soundFile)); channel = sound.play(resumeTime); play_mc.visible = false; pause_mc.visible = true; } public function pauseSong(event:MouseEvent = null):void { resumeTime = channel.position; channel.stop(); play_mc.visible = true; pause_mc.visible = false; } } }