STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229595 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
Visit the flash's index page for basic data and a list of seen names.
Threads (1):
/ > /show/ > Thread 5871 Age: 213.78d Health: 1% Posters: 2 Posts: 4 Replies: 2 Files: 1+3 >> Anon 13932 Testing soundboard Trying to make a sound board with flashdevelop. This is the code I used in ActionScript 3: package { import flash.display.Sprite; import flash.events.Event; import flash.display.SimpleButton; import flash.events.MouseEvent; import flash.media.Sound; import flash.net.URLRequest; [Embed(source = "../Sounds/Vocaroo_s0CEsDXdcBuk.mp3")] public class Main extends Sprite { public function Main():void { var goButton:SimpleButton = new SimpleButton(); var myButtonSprite:Sprite = new Sprite(); myButtonSprite.graphics.lineStyle(1, 0x555555); myButtonSprite.graphics.beginFill(0xff00 0,1); myButtonSprite.graphics.drawRect(0,0,200 ,30); myButtonSprite.graphics.endFill(); goButton.overState = goButton.downState = goButton.upState = goButton.hitTestState = myButtonSprite; goButton.addEventListener(MouseEvent.CLI CK, PlaySound); addChild(goButton); } public function PlaySound(event:MouseEvent):void { var mySound:Sound = new Sound(); mySound.load(new URLRequest("../Sounds/Vocaroo_s0CEsDXdcB uk.mp3")); mySound.play(); } } } [IMG] SoundBoard.swf (171.2 KiB) 800x600, Compressed. 1 frame, 30 fps (00:00). Ver10, AS3. Network access: Yes. Text: Bitmaps: Audio: Yes. Video: <METADATA> [find in archive] >> Anon 13933 Ok it does not work. Ok the problems seems to be that it only works, because I have the sound file. But how do I compile the sound file with the swf file? >> Anon 13955 >># you make it in flash >> Anon 13988 I found the problem. I did not use embed the right way: Here is the updated version. package { import flash.display.Sprite; import flash.events.Event; import flash.display.SimpleButton; import flash.events.MouseEvent; import flash.media.Sound; import flash.net.URLRequest; import flash.text.TextField; public class Main extends Sprite { [Embed(source = "../Sounds/f1.mp3")] private const embeddedSound:Class; public function Main():void { //create the button var goButton:SimpleButton = new SimpleButton(); //set the graphics for the button var myButtonSprite:Sprite = new Sprite(); myButtonSprite.graphics.lineStyle(1, 0x555555); myButtonSprite.graphics.beginFill(0xff00 0,1); myButtonSprite.graphics.drawRect(0,0,100 ,20); myButtonSprite.graphics.endFill(); //define the state of the button goButton.overState = goButton.downState = goButton.upState = goButton.hitTestState = myButtonSprite; //Create text for button: var textForButton:TextField = new TextField(); textForButton.text = "hello"; textForButton.x = (myButtonSprite.width - 25)/2 ; textForButton.y = (myButtonSprite.height - 20) /2 ; goButton.addEventListener(MouseEvent.CLI CK, PlaySound); addChild(goButton); myButtonSprite.addChild(textForButton); } public function PlaySound(e:Event) { var soundClip:Sound = new embeddedSound(); soundClip.play(); } } } |
|