Search Results

Search found 7 results on 1 pages for 'pixelgreaser'.

Page 1/1 | 1 

  • movie silent until button press, flash as3

    - by pixelGreaser
    I thought I could change the Boolean true/false value, but it's not working. How do I get this to hush, until the button is pressed? import flash.media.Sound; import flash.media.SoundChannel; var soundOn:Boolean = true; //music is ON when we start var myToons:TitleMusic = new TitleMusic(); var myChannel:SoundChannel = myToons.play(0,1000); // endless loop, in effect var myTransform:SoundTransform; mySoundButton.addEventListener(MouseEvent.CLICK,toggleSound); mySoundButton.buttonMode = true; mySoundButton.mouseChildren = false; function toggleSound(e:MouseEvent) { if(soundOn) { // turn sound off myTransform = new SoundTransform(); myTransform.volume = 0; // silent myChannel.soundTransform = myTransform; soundOn = false; mySoundButton.myButtonText.text = "click to turn sound ON"; } else // sound is off { // turn sound on myTransform = new SoundTransform(); myTransform.volume = 1; // full volume myChannel.soundTransform = myTransform; soundOn = true; mySoundButton.myButtonText.text = "click to turn sound OFF"; } }

    Read the article

  • SoundChannel, removeEventHandler, AS3

    - by pixelGreaser
    Is there a better way to use the sound channel is AS3? This works, but I hate it when I tap the play button twice and it starts doubling. Please advise. var mySound:Sound = new Sound(); playButton.addEventListener (MouseEvent.CLICK, myPlayButtonHandler); var myChannel:SoundChannel = new SoundChannel(); function myPlayButtonHandler (e:MouseEvent):void { myChannel = mySound.play(); } stopButton.addEventListener(MouseEvent.CLICK, onClickStop); function onClickStop(e:MouseEvent):void{ myChannel.stop(); } /*-----------------------------------------------------------------*/ //global sound buttons, add instance of 'killswitch' and 'onswitch' to stage killswitch.addEventListener(MouseEvent.CLICK, clipKillSwitch); function clipKillSwitch(e:MouseEvent):void{ var transform1:SoundTransform=new SoundTransform(); transform1.volume=0; flash.media.SoundMixer.soundTransform=transform1; } onswitch.addEventListener(MouseEvent.CLICK, clipOnSwitch); function clipOnSwitch(e:MouseEvent):void{ var transform1_:SoundTransform=new SoundTransform(); transform1_.volume=1; flash.media.SoundMixer.soundTransform=transform1_; }

    Read the article

  • mp3 playback stop echoing, as3

    - by pixelGreaser
    Hitting play more than once, causes an echo and I can't stop my mp3 player. What's the best practice for mp3 playback? var mySound:Sound = new Sound(); playButton.addEventListener (MouseEvent.CLICK, myPlayButtonHandler); var myChannel:SoundChannel = new SoundChannel(); function myPlayButtonHandler (e:MouseEvent):void { myChannel = mySound.play(); } stopButton.addEventListener(MouseEvent.CLICK, onClickStop); function onClickStop(e:MouseEvent):void{ myChannel.stop(); }

    Read the article

  • Array, change color, as3

    - by pixelGreaser
    Hi Thanks for the help Yesterday, but I have on more question. How can I change color of text on certain words? My animation plays the text animation of THIS SALE IS RED HOT!!! I want RED HOT it to be red. It seems the array can be indexed in such a way to switch the color from Blue to Red. MY BANNER ADD var myArray:Array = ["THIS","SALE","IS","RED HOT!!!",]; var tm:Timer = new Timer(500); tm.addEventListener(TimerEvent.TIMER, countdown); function countdown(event:TimerEvent) { tx.text = myArray[(tm.currentCount-1)%myArray.length]; } tm.start(); tx.textColor = 0x0000FF; Cont...PSEUDO CODE //var myArray:Array = ["This","Sale","is","RED HOT!!!",]; var spliceRedhot = myArray.splice(-1); //trace(myArray[2]); trace(spliceRedhot); function mySplice(e:Event):void{ if (spliceRedhot = 4){ //Make RED HOT!!! red tx.textColor = 0xFF0000; } else{ //Text is Blue again tx.textColor = 0x0000FF; } }

    Read the article

  • repeat text animation, as3

    - by pixelGreaser
    Hi, My text animation works perfectly, but doesn't repeat. How do I get this to repeat? Sorry I don't know Flash that well, but I just want this to play over and over. Thanks. var myArray:Array = ["Big", "Holiday", "Sale", "Buy", "Now", "And", "Save"]; Timer var tm:Timer = new Timer(500,0); tm.addEventListener(TimerEvent.TIMER, countdown); function countdown(event:TimerEvent) { if (myArray.length>0){ tx.text = myArray.shift(); } } tm.start(); I tried this if (++myArray.length % 10 == 0)

    Read the article

  • visibility false, XML, as3

    - by pixelGreaser
    Hey, I'm using external XML to set flash vars. Alpha works, but not Visibility. How do I get my swf to respond to visibility? Thanks. XML <?xml version="1.0" encoding="utf-8"?> <SESSION> <BGv TITLE="visible true">false</BGv> <BGa TITLE="alpha 50 percent">.5</BGa> </SESSION> SWF //LISTEN AND LOAD XML var myXML:*; var myLoad:URLLoader = new URLLoader(); myLoad.load(new URLRequest("visible.xml")); myLoad.addEventListener(Event.COMPLETE, parseXML); //PARSE XML function parseXML(e:Event):void { myXML = new XML(e.target.data); //MY TEST var bgA:*; var bgV:*; trace(myXML.BGa.text()); trace(myXML.BGv.text()); bgA =(myXML.BGa.text()); bgV =(myXML.BGv.text()); //MY OBJECT bg.alpha = bgA;//This works great bg.visible = bgV;//This has no effect } OUTPUT .5 false

    Read the article

  • SoundChannel, Flash AS3

    - by pixelGreaser
    Is there a better way to use the sound channel is AS3? This works, but I hate it when I tap the play button twice and it starts doubling. Please advise. var mySound:Sound = new Sound(); playButton.addEventListener (MouseEvent.CLICK, myPlayButtonHandler); var myChannel:SoundChannel = new SoundChannel(); function myPlayButtonHandler (e:MouseEvent):void { myChannel = mySound.play(); } stopButton.addEventListener(MouseEvent.CLICK, onClickStop); function onClickStop(e:MouseEvent):void{ myChannel.stop(); } /*-----------------------------------------------------------------*/ //global sound buttons, add instance of 'killswitch' and 'onswitch' to stage killswitch.addEventListener(MouseEvent.CLICK, clipKillSwitch); function clipKillSwitch(e:MouseEvent):void{ var transform1:SoundTransform=new SoundTransform(); transform1.volume=0; flash.media.SoundMixer.soundTransform=transform1; } onswitch.addEventListener(MouseEvent.CLICK, clipOnSwitch); function clipOnSwitch(e:MouseEvent):void{ var transform1_:SoundTransform=new SoundTransform(); transform1_.volume=1; flash.media.SoundMixer.soundTransform=transform1_; }

    Read the article

1