ActionScript 2.0 :: Set A Variable On A Button (the Button Is On Level 5)?

Dec 4, 2003

i was wondering if i set a variable on a button (the button is on level 5)

Code:
_level5.current_selection = "credits"

and i would like the movie on level 1 to recognize that this button (on level 5)has been pressed,is this script correct on an empty keyframe in level 1.

Code:
_level5.current_selection = "credits";
if (_level5.current_selection == "credits") {
loadMovieNum("credits.swf", 2);

[code].....

i've tried this and it isn't recognizing the variable.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: [CS3] Keep Button On Top Level?

Feb 18, 2009

I am working on a project and have a print function that basically does a screen grab and prints it out. I load a number of external swfs into levels of the main swf.I want the print button to stay on the top level. Is there a way to define what level a button is on?I want to define the button on level 20. I contemplated loading it in as another external movie clip, but the script won't work if I do that.

View 1 Replies

ActionScript 2.0 :: Disable Button On Another Level

Aug 10, 2005

My main movie is on level 0, of course. On level 0 I created an empty movie clip named "container". Now, I load another movie into container, and I loaded it on Level 1. Now, I want to put a code inside a Movie Clip that is on level 1, which is the new, loaded movie that will disable a red button on level1. Here's the code I used:[code]That worked to no avail as well. So, I'm wondering if the code that disables and enables buttons only work with a handler? Like an onClipEvent or on (release) handler? I'm puzzled right now, because this is really elementary but i just don't know it right now.

View 2 Replies

ActionScript 2.0 :: CS3 Button - Make The Next Level Harder

Mar 30, 2009

i've got that when you click a button it takes you to the next frame/level of the game, but i want to make the next level harder, meaning you have to kill all the enemies to goto the next frame/level, so, how do i make it so you have to click ALL 3 buttons on the stage to go to the next frame? Or is there another way to do this?

View 4 Replies

Animation - Volume Level On Button In Flash?

Jan 13, 2011

i want to control sound in my movie clip by the button which i designed in flash. for ex.: my default sound is 100% on home button & when i click on contact(last button) the volume level goes to 20% same as in between buttons.i use this script to call the sound in flash

bgSound = new Sound(this);
bgSound.attachSound("sound1");
bgSound.start(0,99);

now tell me what i put in buttons to manage sound level.

View 2 Replies

Actionscript :: Add A Simple Restart Level Button?

Nov 5, 2011

In a mini game I made, I wanted to add a simple restart level button. All goes well during the first run of the game, but after hitting the restart button (which essentially just unpauses it by flipping a few booleans and such) the action listener to move the character in the game isn't responding. I put a trace() of a boolean switch for the action before and after hitting reset, and prior the value is correctly being displayed, but after the value is not.

I know I'm probably going to be asked to post my code, but it's quite long and unorganized, so I'm curious if there is a known issue relating to this.

View 1 Replies

ActionScript 1/2 :: If Score Over Certain Point Next Level Button Visible In Game

Oct 2, 2009

I'm making game, where I must collect points. In end menu screen, i want that if my score's over 200, a next level button will be visible. Now it's visible every time when timer's out. I have tried this code
if (score < 200){
this.visible == false;
} else
if (score >=200){
this.visible == false;
}

View 3 Replies

ActionScript 3.0 :: Create A Variable And Get The Button To Add One To That Variable?

Jan 28, 2010

I want to be able to have a number displayed on the screen that when one of the arrows next to it (up/down) is clicked it adds 1 to the original number (lets say 72). Then when they click the "save" button that really just takes them to the next frame (or a frame somewhere else in the movie), which is a confirmation page, I want the number they ended at to display on the confirmation screen.
I'm thinking that it is partially because I don't know what to search for.I know I have to create a variable and get the button to add one to that variable.

View 2 Replies

ActionScript 2.0 :: Nav Button States - Button To Stay In It's Active State Until Another Button Is Clicked

Dec 17, 2004

I have a menu with five nav buttons (atcually MovieClips). Each has three frame labels: "on", "stay", and "off". The rollover and rollout animations play flawlessly, but I'm at a loss as to how to give each button a sticky "active" state. I'd like the button to stay in it's active state until another button is clicked, then I would like it to play it's "off" animation. Each MC has this code:

[Code]...

View 2 Replies

ActionScript 2.0 :: Take A Static Text Field, Convert It Into A Button, And Use It As A Button,but Button Not Working ?

Mar 7, 2010

I want to take a static text field, convert it into a button, and use it as a button. I need it static, because I changed orientation, and I do not know how to do that otherwise. The problem is, even though I converted it to a Button symbol, it does not work when I test the movie. It works fine with "Enable simple buttons", but when I test it, the button is not there, no change in mouse cursor, no reaction at all.So this is what I did:

Made text. // static, not selectable, Orientation: vertical left to right, / //rotated; Two filters: Drop Shadow and Glow;

Converted text field to Button - Symbol (scrollBT)

Editing the Button,I put the same content (the static text field) in all four frames: No luck, not working. without the Hit frame filled (which I think doesn't really make a difference): No luck, not working.Tried again, converting the static text field in the button into a Graphic Symbol: No luck, not working.Tried again, and put some differences in the frames for "ON" and "OVER" etc.: No luck, not working.Tried again, duplicating a similar, working button, edited it, and: No luck, not working.

To the button itself and the AS: The button will be a scroll-button for a text field, with different scroll speeds on rollover and press, but nothing else. The code for that I have (I think). It's something like (and please excuse my incorrect syntax here, but I'm typing from memory; still, I use the Script-Assistant and my syntax is apparently correct; it's also working with other buttons):

on {rollOver} {
function (scroll) {
textfieldtxt.scroll - = 1;}[code]....

I'm at the end of my wits. The only difference I can tell from other (working) buttons I did the same way, is that the scrollBt does not do anything except scrolling, while all of the others have frame actions (gotoAndplay etc.) associated with them.

View 1 Replies

ActionScript 2.0 :: Button Set Variable Value?

Jul 24, 2010

I have a mc button which when click should set the variable associated with it. Here is the code I have on the first frame of the AS2 MC Button, the idea is when clicked this button sets q1a to 30 and q1b and q1c to 0 so when the SUBMIT button on main timeline is click it advance to next frame on with dynamic text and appropriate variable label on the main timeline.

clicked=false;
over=false;
this.onRollOver=function(){

[code].....

View 5 Replies

ActionScript 3.0 :: Use Button To Set A Variable?

Dec 10, 2011

I would like to use a couple of buttons that I made to set a variable. I'd like to use the instance name of the button(s) as the value stored as the variable. how can i code this?

View 3 Replies

ActionScript 2.0 :: Set A Variable On A Button?

Dec 4, 2003

i was wondering if i set a variable on a button (the button is on level 5)

Code:
_level5.current_selection = "credits" and i would like the movie on level 1 to recognize that this button (on level 5)has been pressed, is this script correct on an empty keyframe in level 1.

Code:
_level5.current_selection = "credits";
if (_level5.current_selection == "credits") {
loadMovieNum("credits.swf", 2);

[Code]....

i've tried this and it isn't recognizing the variable.

View 1 Replies

ActionScript 3.0 :: Variable Button Is Not Defined?

Jul 3, 2009

I'm making a contact form, and I keep getting two errors when I try previewing it in a web browser.

ReferenceError: Error #1065: Variable Button is not defined.
ReferenceError: Error #1065: Variable ComponentShim is not defined.

I don't know what these errors mean. Can anyone give me an explanation? I am using Flash CS4 with ActionScript 3.0. The first function is for the contact button to go to the contact page. The code following is the code for the contact form.Here is my code for the contact form:

Code:
function onContactClick(e:MouseEvent):void
{
gotoAndStop("contact");[code]............

View 6 Replies

ActionScript 1/2 :: Change A Variable By Button?

Dec 12, 2011

I need to change one variable at the click of a button the problem is that when I enter the first frame i declared a _global var _global.conteudo =null;
 
In the second frame:
this equal a _global to :
_global.conteudo = "enterprise.swf";
 
But  when I click a button , i need change my _global var  for example:
 
on (release){_global.conteudo="my variable declared";}

View 18 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 2.0 :: Set A Variable When That Button Is Clicked

Apr 14, 2008

I'm working on a game, where if you click an answer, it will double check to see if that's the one you really want. So I tried to set a variable when that button is clicked. On another set of buttons, I placed an if / else statement, but it doesn't seem to be working.[code]

View 2 Replies

ActionScript 2.0 :: Button Name Controlled By Variable?

Mar 13, 2009

I have several buttons I need to turn on and off (visibility and alpha) but the function I have written that determines if a given button should be turned off works based on a few variables. I need to be able to control which button is turning on and off with these variables.

I have tried this ("btn" + i)._visible or alpha but does not work. how I can accomplish this?

View 11 Replies

ActionScript 2.0 :: Set The Variable With The [currnt] Button Name?

Mar 22, 2002

i'v 3 button on a line, if u click button1 it goes below the line, if u click button2 it should go below the line and button1 should go back to its previous position. this should work for the 3 buttons.So i set a variable on the first frame of my movie

var discesa;
set(discesa, "null");

then i wrote this code on every button so in the button timeline i go to the label that restores the position of other buttons, and in the main timeline i go where i need to.

on (release) {
// the button goes down in its timeline
gotoAndPlay("down");

//and i change frame in the main timeline
_root.gotoAndPlay("b3");

then the other 2 buttons go up in their own timelines if the variable is set with their values

if (discesa, "b1") {
_root.b1.gotoAndPlay("up");
} else if (discesa, "b2") {[code]....

last but not least i set the variable with the currnt button name

set(discesa, "b3");

View 6 Replies

ActionScript 3.0 :: Access Variable From Different Level?

Nov 27, 2011

Normally, I declare a variable at the very top of all my code like, var myObj: Myobj = new Myobj();...
 
but for some reason the the new variable being declared is necessary to present within the function, like displaying same objects in the library using for loop.
 
I notice that variable declare within a function will not be accessible outside the function or from another event handler or from another function....
 
I have seen code that make it possible my declaring a new variable?

View 4 Replies

CS3 :: Get The Variable From Xml File And Assign To A Flash Button?

Jun 12, 2009

how to get the variable from xml file and assign it to a flash button?the button i create it myself.

View 2 Replies

ActionScript 3.0 :: Declare A Variable For A Button Component?

Oct 8, 2009

I am trying to declare a variable for a button component in AS3. I have one button named btn1 and tried to write:

import flash.controls.Button;
var btn:Button = mc.test.btn1;

I got an error: Definition flash.controls.Button can't not be found....What type of data type should I assign to the btn variable...?

View 2 Replies

ActionScript 2.0 :: Variable Button Values In Loop?

Mar 15, 2010

I have a query regarding assigning values to buttons in a for loop, I will explain:This is a string which I want to assign to a button value via getURL:

var myURL = "http://www.mywebsite.co.uk" + "/?Group=" + mySharedObject.data["destination"+i] + "&" + "SearchType=654&" + "Target=offers&" + "Paging=on&" + "HotelName=" + mySharedObject.data["hotel"+i];

[code].....

View 1 Replies

ActionScript 3.0 :: Extract A Button's Name From Its Event Variable?

Sep 3, 2009

In the code below, the trace gives the instance name, not the button name.
 
How do I get the button name?

var b1:Button = new Button();
b1.move(400,100);
b1.label = "B1";

[Code]....

View 3 Replies

ActionScript 1/2 :: Increment A Variable With A Button Press?

Aug 29, 2007

what is the proper way to increment a variable with a mouseevent listener?

var myMinVarable:int = myNewMinVariable;
myNewMinVariable = 0;
var myMinDMinVariable:int = 10

[code].....

View 11 Replies

Actionscript :: Declare A Variable For A Button Component?

Aug 1, 2010

I am trying to declare a variable for a button component in AS3. I have one button named btn1 and tried to write:

import flash.controls.Button;
var btn:Button = mc.test.btn1;

I got an error: Definition flash.controls.Button can't not be found....

View 1 Replies

Accessing Variable From Frame With Button In Flash

Mar 24, 2011

I am a beginner in Flash development and I was just recently assigned to fix an old Flash project at my work. Essentially, the application is a video booth whereby users can record up to 60s of video via their webcam and then share it either via email, twitter, or facebook. When the application is started, a video ID is generated, and that is used as the video's file name when it is streamed and saved to the server. I am sure there is a better way to do this, but the way I came up with is to grab that video ID and pass it to the "Share" page as a URL variable, and then use that to access and share the video from the server. How I can access the video ID from the button that is sending the user to the "Share" page.

Here is the code:
var nc:NetConnection = new NetConnection();
var ns:NetStream;
var cam:Camera;
var mic:Microphone;
var vidId:String = configName();
function tracer(p_s) {
[Code] .....

View 1 Replies

ActionScript 2.0 :: Use Button To Increase / Decrease Variable?

Jun 29, 2010

I want to use two buttons, one for increase and the other for decrease, to change the numeric value of a variable. I will use this variable to call a line width in some lineStyle code that I have. Basically, the user will be able to use the buttons to change the width of the line they are drawing in real time. I have attached the fla with the beginnings of this section.

How do I get the buttons to affect my variable?

View 9 Replies

ActionScript 3.0 :: Change The Value Of Variable By Clicking A Button

Aug 4, 2010

I have some buttons and movieclips. I want to create a variable. I want to change the value of this varible when I'm clicking a button.

View 5 Replies

ActionScript 3.0 :: Get Variable To Goto Button Frame

Sep 15, 2011

I'm pretty new to AS3 but I want to get my buttons to play the same movie then go to their button function. i.e., Picture button > play movie (same as all buttons) > picture frame.

This is the code on my buttons
ActionScript Code:
stop();
import flash.display.MovieClip;
import flash.events.MouseEvent;
var currentButton:String;
[Code] .....
Then at the end of the movie I tried using a variable to link the button to its frame

ActionScript Code:
stop();
if (currentButton == name) {
content.gotoAndStop("music");
} else if (currentButton == name) {
content.gotoAndStop("book");
} else if (currentButton == name) {
content.gotoAndStop("stereo");
}
I know the scripts messed up but not sure I really get the variable thing as yet.

View 2 Replies







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