ActionScript 3.0 :: Buttons To Switch The Visualiser On And Off?
May 8, 2011
I have a script that creates a music visualiser from audio that is played. I have a buttons to switch the visualiser on and off. On works Fine! but when i click to switch it off, the visualiser is still there.My script is below. Can anyone see what im doing wrong here?
ActionScript Code:
function playMusic(e:MouseEvent):void {
myMusic = new Sound();
if(channel) channel.stop();
I need to include a swf file on my client's web page. The swf file includes 4 movie clips appearing one by one. Each clip links to their designated page. I want to have small buttons to let viewers to click and switch to the clip they want. When click, the still shot (may be the last frame) of the clip appears. [URL]
I am working in CS4 and am trying to use AS3.0 to make buttons that go to different scenes. I am not using "Scene 2" in my AS; instead, I am labeling frame 1 of Scene 2 and am using that frame label in my coding.
Unfortunately I cannot get it to work properly. I am about 8 hours into trying to fix it and cannot seem to get it resolved.
I have attached the .fla file for your reference. I have also pasted my AS coding below in case it is a simple thing (probably not!). The movie needs to stop at a certain frame so the buttons are available for the users.
stop(); btn2_btn.addEventListener(MouseEvent.CLICK, showimage); function showimage(event:MouseEvent):void {
I am new to this forum. Not an experienced Flash user. I need to include a swf file on my client's web page. The swf file includes 4 movie clips appearing one by one. Each clip links to their designated page. I want to have small buttons to let viewers to click and switch to the clip they want. When click, the still shot (may be the last frame) of the clip appears.
I'm working on a slide show which I would like work automatically (fade in and out) as well as being able to be prompted to switch via buttons... I know this is a super simple thing, but I cannot get all the buttons to work. The buttons are copies of the same instance with different instance names and are located at the 3 respective frames in timeline where the pieces of slideshow should fade in/out ( I hope this makes sense) I get the first set of buttons to work:
import flash.events.MouseEvent; controls.bttn1.addEventListener (MouseEvent.CLICK, clickSection1); function clickSection1 (evtObj:MouseEvent) { // trace shows what's happening in the output window
[code].....
but when I add more buttons that are located later on in a timeline, I get the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at INDEX_TEST_r3_fla::MainTimeline/frame1()
I'm currently working on a project which has a swf (zoom) which zoom/pan a loaded swf of a map (carte_web.swf). Everything went well until I got more requests. There is now two maps, same background, one with images and one with only a road. I'm trying to add code to two buttons on a toolbar generated by the zoom.swf, to switch between the two maps, without loosing it's zoom/pan My maps are both object-oriented Flash programming. I have spent 27 hours, trying to find a way and I'm definately at my wits' end!
I got a suggestion " in loading both your swfs into one sprite separately. Then switching between the swfs by removing and adding them to their parent sprite. The parent sprite is what you'll be zooming. " I tried everything!!!
What I'm trying to do is create a program that, depending on 2 variables, multiplies another variable by a static number. Heres the code I have so far:
Im trying to create a program that, depending on 2 variables, multiplies another variable by a static number. A friend suggested I use case/switch instead of if/else statements,which is what I was using before.
how I can switch between different songs?The idea is that an animation will loop continuously (graphic, not a movieclip), and there is one button that will allow the user to change the background music.
I'm currently building a Flash Game for my work. I made a switch to check if my items fell into the right bucket. But when I was developing all my other functions I realized that I could handle this in an If Else instead...So the question is: What is faster (less CPU intensive), a switch or If Else?Here is my switch:
Code:
function getPoints(naam,orgNaam,baksoort):Void { switch(baksoort){ case "bak_B01":[code]....
I followed a tutorial about how to create a simple website. The buttons i've created SHOULD fade out the current page and fade in the new page. In it's current state it fades out the m1 instance (mainmenu_mc) but won't fade in the new page selected(p1,p2,p3orp4). After it's faded out if i click in the same area the button was the mainmenu_mc page flashes onto the screen. and when i let go of clicking it, dissapears again.
Code: var m1:mainmenu_mc =new mainmenu_mc; var p1:page1 =new page1; var p2:page2 =new page2;[code]......
I am trying to create a weekly calendar. I have a 'switch' statement that shows the week dates and the name of month the week relates too. I have three functions
1. takes the pc date and converts it into the day of the year. eg between 1 and 365
2. it takes the day from 1. and assoicates it to the week number eg 1 - 52
3. functions that are associated with a previous and next button that use the current week number based on the pc date and count up and down.
This is where I have come unstuck. This is the code for my 'next' button.
Code: function onClickNext(event:MouseEvent) { if(currentWkNum != 53)
I am a pretty good programmer in as3 - but I don't know OOP. -- and I am not so good that I don't have a ton learn -- when I look at all the differnt script commands I know my knowledge is tiny. I am now at the point where I could look at a website and make a pretty good attempt at coppying it and most my programming is dynamic driven. So I was wondering by making the leap to OOP would I have relearn a lot of what I know -- and what are the advantages
I've got a variable called coins which contains the amount of coins you have.I've also got a movieclip called customer_marker_mc which I want to change color depending how much coins you've got...I want 100 (or more) - 91 to give one color and 90 - 81 another and so on.[code]...
how I could create a switch in Flash. I have the movieclip, but I don't really know how to program it. I want it to work something like: if hitTest with "char" (our character) and the user is pressing space then gotoandstop(2);. Obviously, that's just the basic idea of how the switch would work EDIT: Here's my current code:
I followed a tutorial about how to create a simple website..The buttons i've created SHOULD fade out the current page and fade in the new page. In it's current state it fades out the m1 instance (mainmenu_mc) but won't fade in the new page selected(p1,p2,p3orp4). After it's faded out if i click in the same area the button was the mainmenu_mc page flashes onto the screen. and when i let go of clicking it, dissapears again.
Code: var m1:mainmenu_mc =new mainmenu_mc; var p1:page1 =new page1; var p2:page2 =new page2;[code]......
I installed the new Flash Builder.Does anybody know how to switch the language to english?Looks like the installer installs eclipse in the langauge of the os.in my case that was german.I know you can change the language for FlashBuilder in Windows by editing one of the dll's. How to get the same result on MacOs?
I have a job where the client wants to switch an animation (movieclip) on the stage between the times of 10 a.m. and 12p.m. EST then the off time will just revert back to the original animation.
I've been having a problem for the past month or so, and for the life of me I can't work out how to switch off the pen tool I have in actionscript. I have the following code in frame 2, and frame one doesn't have anything, meaning it doesn't allow the user to draw. However, after returning to frame 1 from frame 2, you can still draw. Is there anyway to turn off this drawing actionscript completely when going back to the first frame?
How would I switch between 2 sounds in Actionscript?I need something where depending on a Boolean, a certain song is playing (a loop) and every time you switch, it saves the time so when you go back,instead of it starting at the beginning,it starts where last stopped.Say I was playing Sound one and stopped it at 0:25.And when I went back to Sound one it started at 0:25.
I have made a button to function like a switch in that it has both an on and off state. However, I can only get it to switch between the on and off state once when it's pressed, with nothing happening after it has been turned off.The code is as follows:
I need to replace some text - it's actually a bunch of textInput area data captured and placed together {inputArea1.text}{inputArea2.text} style - and have it placed in an mx:Text text="{inputArea1.text}{inputArea2.text}".So I have the smart idea to pull a switch case, where the case condition is the id of the canvas and it's pulling from the textInput areas.My output from the aforementioned string into my text just yields: Code:function Function() {}I complete this, I can sleep.
i do not possess any knowledge in using of scenes and i got a proj which requires me do so and i been using the alpha-ing and tweens to do the button switching its really tiring and confusing
so can anyone enlighten me on how to use scene to do switching of 1 scene to other along by using a 'next button' and 'previous button'
In this example, is there anyway to fade in and out 'mcContactAmer' and 'mcY' as well as place them at specific coordinates, other than externally load them as swfs? This is the only thing holding me back from moving forward on this project and my boss would like to move forward,