ActionScript 2.0 :: Button To Switch Light On / Off

Nov 19, 2003

I am really new to Flash n Actionscript and have been dropped in to make a switch that will make a light come on in the first click and off on the second, on on the third and off on the forth etc... I have created the switch as a button and the light on/off as two movie clips....
What coding would i be looking to add to make this switch work...

Previously I have been given this... but its not working
//this is for the button (switch)
on(release) {
if (_root.light_on:active == 1) {
setProperty("_root.light on", _visible, "1");
_root.light_on:active = "0";
} else {
_root.light_on:active = "1";
setProperty("_root.light_on", _visible, "0");
}}

//This is for the light on
onClipEvent (load) {
active = "1";
setProperty("_root.light_on", _visible, "0");
}

View 7 Replies


Similar Posts:


ActionScript 2.0 :: Button Switch's Light On/off?

Nov 19, 2003

n Actionscript and have been dropped in to make a switch that will make a light come on in the first click and off on the second, on on the third and off on the forth etc... etc...

i have created the switch as a button and the light on/off as two movie clips... what coding would i be looking to add to make this switch work...

previously i have been given this... but its not working
//this is for the button (switch)
on(release) {
if (_root.light_on:active == 1) {

[Code]....

View 7 Replies

ActionScript 3.0 :: Making A Button That Will Light Up When Scroll Over It

Jan 24, 2009

So I was working on making a button that will light up when I scroll over it, not instantly but more realisticly. The button starts out gray and when I scroll over it I want it to fade to red.

So I made a new AS3 Flash file and drew a simple gray box, made it a button, and inside the button I made the box a Movie Clip, shape tweened it so that it fades from gray to red in a period of 5 frames.

Now I'm just stuck on the scripting part, I made a new layer inside the movie clip for the script and have this typed in:

Code:
import flash.events.MouseEvent;
rectangle_mc.addEventListener(MouseEvent.MOUSE_OVER, mcOver);
function mcOver(event:MouseEvent)void{
play.rectangle_mc
}

I don't even know what import flash.events.MouseEvent; even means.

But what I'm trying to accomplish here is to make the shape tween Movie Clip only play when the cursor is over the button. So that when I scroll over the button it fades from gray to red. Sounds like a plan, but I can't figure out the function part where it says play.rectangle_mc,

View 2 Replies

Professional :: Making Button From XML Dropdown Light Up On Particular Page

Feb 28, 2012

This might be trying to be too tricky, but I have a set of keyframes on the timeline that correspond to the buttons on my xml drop down. When I am on a particular frame, I want the button for that frame and the mainItem button that it drops down from to have some sort of highlight or extra glow. This is meant to be so that a user can see where they are in the project at any time. All the code is included in my previous posts on xml drop down menu..

I can find the buttons by checking if they have certain text on them, so now I want to
1) Set a variable on each keyframe
var a:String="page1";
and then have some code that says 
if(a=="page 1")....[go and get the button] e.currentTarget.menuText.text=="Questions" [and do something to it ]<-- except it wont be the current target it will just be out there with that text on it..

View 7 Replies

ActionScript 3.0 :: Code To Make A Button Light Up On Roll Over Of A Mouse?

Dec 1, 2010

I have a home page thing. all the buttlons fly in and such all i need is so when a mouse hovers over a button it lights up or the brightness increases and when you remove the mouse from the button it goes back to normal
please help me out.

View 5 Replies

ActionScript 2.0 :: [CS3] : Making A Switch (button)?

Feb 18, 2009

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:

Code:
switch1.onPress = function() {
switch1.gotoAndStop("on");
_root.onEnterFrame = function() {

[code]....

is there a way to make it so that the switch works continuously, not just one time?

View 1 Replies

ActionScript 2.0 :: CheckBox As Switch For Button On/off

Jul 23, 2011

never really used checkBoxes much and wondering what the best AS2 is to use one as a "switch" ?

i.e. place a checkbox which is default unchecked and if the user checks it {do something} and if the user then unchecks it {undo that something}.

I'm thinking about the _alpha of a button or an MC as an example / test.

Check the box: anMC = _alpha 100, unchceck the same box: anMC = _alpha 50.

I'm happy either way with code on the checkbox or an even listener on a frame (preferred) but would like to learn how to use checkBoxes as a switch.

View 2 Replies

ActionScript 3.0 :: Button To Switch On A Video?

Jun 7, 2011

I'm very basic at flash, but sofar I've created a little portfolio page with a video background as a front page. I want to add a button to the background which will turn of the current video and play another video and when the button is pushed again it will play the first video again.[URL]
 
here's my as for the videobackground:
 
import VideoBg; 
var videos:Array=new Array('videos/bird_short.f4v');
var num:uint=1;

[Code].....

View 11 Replies

ActionScript 2.0 :: Button To Switch The Variable Off

Dec 17, 2003

Here's a really easy (Not so easy for me) question for you. First person to answer rules the. I have a button that switches a variable from 0 to 1.

on (press) {
_root.pageone = 1;
}

I want the same button to switch the variable off. I've been trying "if else", but my syntax is rubbish. How do I code this statement On Press Button > if _root.pageone = 1 change to 0 > if _root.pageone = 0 change to 1.

View 2 Replies

ActionScript 3.0 :: Get Button To Switch Out From Loaded Swf

May 18, 2011

I'm a designer struggling to learn advanced actionscript. It's quite a challenge,
One of the challenge i'm having right now is: I have my main timeline(swf). i'm loading in 2 separate swfs into two separate holders on the main stage/timeline/swf. whatever it's normally called. One of the loaded swfs is a menu and the other is a page. Basically i'm designing a learning application. The menu alllows you to jump to a specific place in the course rather than a next button of sorts which is also in the course.

When a different page is loaded i need for a button(movieclip) that's located in the menu swf to swith out with a new button that's located off the stage somewhere.(these buttons are located in the menu swf off stage) so i need the loaded page swf, to talk to the other loaded swf(menu) everytime it or another page is loaded. I've seen simular references to having a loaded swf talk to the main timeline swf but i haven't been able to find a reference for two loaded swfs thats loaded inside holders, to talk to each other.

View 1 Replies

ActionScript 3.0 :: Switch A Video To Fullscreen From A Button ?

Jul 29, 2010

What is the best way to switch a video to fullscreen from a button in AS3? Like the fullscreen button in FLVPlayback component - I'm aware the FullScreen tag needs to go into the HTML...

View 1 Replies

Professional :: Switch Between The Normal And Over-states After The Button Is Clicked?

Jan 30, 2010

I'm pretty new to this and racking my brains on the following problem: I have a movieclip-button, with 3 states (normal, over and clicked). I want to disable the functions in actionscript 3 that switch between the normal and over-states after the button is clicked, and not enable these functions for this button until another button is clicked. What's the best/ simplest way to do this?

View 5 Replies

ActionScript 3.0 :: Switch In A Full Screen Mode Without A Button?

Jan 25, 2011

Is there a way to switch in a full screen mode without a button?
 
I tried like this but it's not working:
 
function setFullScreen():void {    if (stage.displayState=="normal") {        stage.displayState="fullScreen";        stage.scaleMode=StageScaleMode.NO_SCALE;    } else { 

[Code]....

View 1 Replies

ActionScript 2.0 :: Button Switch IF Statement For Video Player?

Oct 2, 2008

I am working on a video player that will have different Languages. The problem that i am have is that i can get the video to switch but i cant get the video to switch back. I have uploaded the file and here is the code that i have have a problem with.

lang.onRelease = function() {
if  play = English)
{

[Code].....

View 1 Replies

ActionScript 1/2 :: Button Type Toggle To Switch Fullscreen Ad Back

Jul 22, 2010

Any reliable full screen code for actionscript 2.0. I have search but can't get any thing that works proper. I just need a button type toggle that switches the screen to full screen and back.

View 1 Replies

ActionScript 2.0 :: [Flash8] External File - Button To Switch Between Backgrounds

Mar 9, 2006

I'm making a flash banner for a client, it has a button to switch between backgrounds, however, how do I say something like

[Code]...

View 7 Replies

ActionScript 2.0 :: Make A Simple SWITCH Statement With Button._name As Variables?

Jun 18, 2007

I want to make a simple SWITCH statement with Button._name as variables for CASE

so i got this code:

Code:
Button.addListener(_root);
_root.onRelease = function() {

[Code]....

View 2 Replies

ActionScript 2.0 :: Make Movie Clip Randomly Switch Colors With Push Of Button?

Jul 7, 2004

I want to implement having a movie clip randomly change color.How can I make my movie clip randomly switch colors with a push of a button??By the way I'm using flash MX and I am still intermediate when it comes to coding.

View 3 Replies

Professional :: Keep The Light On After (onClick)?

Apr 8, 2011

I have a 6 button menu system: when user clicks on a main menu link it will highlight red and light up a light right to the left of the link letting them know they have clicked successfully. After the initial click it will bring down a sub menu with links. However, after they release the mouse button, the little green indicator light goes off. I want that little green light to stay on until they move the mouse outside of the slide panel with the sublinks. how do I keep that light on until user moves mouse outside of the bounding area of the sub-panel with sub links? what code do I need to insert?SECOND:When I go to publish in html, my slide panel which contains the sublinks is chopped off. How do make it were the submenu goes over and on top of my webpage contents right below it instead of increasing the size of my table.

Here is a copy of my code. I will be posting an image in about 30 minutes or less:
// ON CLICK EFFECT - The main menu's sub-menus will slide down once user clicks on a button.// The sub-menu will raise up and disapper once the user's mouse leaves the sub-panel area.

import fl.transitions.Tween;import fl.transitions.easing.Regular;import fl.transitions.easing.Elastic;
stop();

[code].....

View 22 Replies

Creating Pulsating Spot That Looks Like Red Light

Oct 16, 2011

I want to make a pulsating spot that looks like red light. The pulsating effect is done but the circle with gradient red goes from red center to black. I want it to go from red to nothing/transparent, so that whatever background can be seen through the edge of the "light". Is that possible? I use Flash 8.

View 2 Replies

Flash 10 :: 16 X 16 Light Grid, 3d Query Also?

Sep 16, 2011

I am in the middle of designing a 16 x 16 grid sequencer with a row of buttons that light up and sweep across the screen as shown in the attached picture. Basically i was wondering would this be best done in flash cs5 as its hopefully going to be coded with actionScript or should i use other adobe apps like illustrator etc? I was also wondering how to get the lights to trail behind as the lights travel across the buttons?

Just a quick query, i work with Lightwave 10 on the mac and i was wondering it it can be incorporated into flash cs5 at all?

View 0 Replies

ActionScript 3.0 :: Camera Light Or Flash

Oct 9, 2011

Does anyone know, is it possible to control the camera flash or light With as3.Also the camera flash on the android.For instance can I turn on the camera flash light on android?

View 2 Replies

ActionScript 2.0 :: AttachMovieClip And RemovieMovieClip Don't Light Up?

Oct 16, 2011

in order to use removeMovieClip, I think I have to use attachMovieClip first, right? What I want to happen is drag and item with the mouse, and then on release make it stop dragging and make it look like it returns to its original spot.

ActionScript Code:
mirror_inv.onPress = function () {
mirror_inv.swapDepths(1);[code]....

Also the commands attachMovieClip and removieMovieClip don't light up in AS. However just attachMovie and removeMovie do light up, not sure if that is same thing..

View 4 Replies

Actionscript 3.0 :: How To Approach Dynamic Light

Mar 9, 2012

Our game is a bird-eye view game, with a dark atmosphere. The player carries a flashlight which can be used to brighten up the environment.So far, we've tried using masks, and although it works, it's not very effective. Every object needs a seperate mask, it tends to use a lot of CPU and is generally a mess to work with.I've considered using a system of black tiles at 90% alpha all over the room, which change their transparancy when the player moves near - but I was unsure.

View 5 Replies

ActionScript 2.0 :: How To Get Light Hanging From Top Of Page

Jun 12, 2007

I'm trying to get a light that is hanging from the top of the page by a chord to be drag-able and then for them to be able to let go and the light swing back and forth. Right now I've got a pretty cool as that is onLoad it will swing and gradually slows down until it is sitting still, but I'd like to have it have a little more elasticity added to it for them to be have some fun with the hanging light..

View 1 Replies

ActionScript 3.0 :: Masks For Light Source?

Dec 6, 2009

I'm using shapes drawn to sprites to try and get a fog of war effect.Basically, I have a large black rectangle that goes over the screen as darkness, and I need to have multiple towers that have vision fields that would cancel out the darkness.I'm using masks too, but I can't get the right effect.

View 2 Replies

Creating Simple .exe With A Light Flashing Image?

Nov 12, 2010

Was just wondering that tool do i need (an open source tool) to create a very simple table with a blinking light on an image and turn that into an .exe?

View 1 Replies

ActionScript 3.0 :: Making Xml Buttons Light Up On Certain Frames?

Feb 29, 2012

I have got this menu from intronet and got it working, now am trying to be tricky, I want to have a way to make certain buttons light up when on a particular page, so for example I have got Brian's Vision button taking me to frame 2. How can I get certain buttons to be highlighted on that frame?Basically in my code so far I can listen to a button that is clicked and determine what text it has.. so who can I identify a button with a certain text and make it do something (without clicking on it?)

Code:
ans1.ans1text.text="beans";
ans2.ans1text.text="chicken";
ans3.ans1text.text="rice";

[code]....

View 5 Replies

Actionscript 3.0 :: Light Colors Are Kinda Blury

Nov 10, 2009

Does anyone knows why light colors are kinda blury...

View 2 Replies

ActionScript 2.0 :: Stopping The Light Ray Effect Of The Text

Nov 21, 2005

I am following the code from a site in which a text has light rays effect. But it the light ray effect is continuing even after the end of the movie. stopping the light ray effect of the text. The code for the light ray effect is as follows: i = "1";

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved