STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229595 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
This is resource VHDRVE3, an Archived Thread.
Original location: http://swfchan.org/5871/ Recognized format: Yes, thread post count is 4. Discovered flash files: 1 / > /show/ > Thread 5871 Age: 213.78d Health: 1% Posters: 2 Posts: 4 Replies: 2 Files: 1+3 >> Anonymous 23jul2014(we)17:05 No.13932 OP P1 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(0xff000,1); myButtonSprite.graphics.drawRect(0,0,200,30); myButtonSprite.graphics.endFill(); goButton.overState = goButton.downState = goButton.upState = goButton.hitTestState = myButtonSprite; goButton.addEventListener(MouseEvent.CLICK, PlaySound); addChild(goButton); } public function PlaySound(event:MouseEvent):void { var mySound:Sound = new Sound(); mySound.load(new URLRequest("../Sounds/Vocaroo_s0CEsDXdcBuk.mp3")); mySound.play(); } } } [IMG] SoundBoard.swf (171.2 KiB) 800x600, Compressed. 1 frame, 30 fps (00:00). Ver10, AS3. Network access: Yes. Text: No. Bitmaps: No. Audio: Yes. Video: No. <METADATA> [find in archive] >> Anonymous 23jul2014(we)17:07 No.13933 OP P2 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? >> Anonymous 24jul2014(th)22:31 No.13955 A P3R1 >>13933 you make it in flash >> Anonymous 25jul2014(fr)18:36 No.13988 OP P4R2 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(0xff000,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.CLICK, PlaySound); addChild(goButton); myButtonSprite.addChild(textForButton); } public function PlaySound(e:Event) { var soundClip:Sound = new embeddedSound(); soundClip.play(); } } } |
|