ActionScript 2.0 :: Use A Variable And Make It Assume A Different Value?
Sep 3, 2004
I'm trying to use a variable and make it assume a different value acording to the option selected on the combobox and it's been hell for me.
Supose I have a variable named "favouritesport"... I would like to have a combobox with 3 items (baseball, football, basketball). As you choose one of the sports the variable should change.
Ex. If someone chose baseball than it woul make favouritesport=baseball
View 1 Replies
Similar Posts:
Feb 23, 2009
Does anyone know how to:stop a movieclip on mouse click, make the movieclip wait for, say, 3 seconds and then assume playing again from the same frame that it stopped on
(The movieclip is an instance on the main stage, the actual footage is placed in a seperate mc)
Im using Flash 8 (gave up on 10 as I realised I would have to post questions here on how to make a simple button )
View 1 Replies
Dec 9, 2009
I am working on a presentation deck with a resolution of 2880 x 1571. I am in need of some help on two fronts for the final result. First off, I need it to go to fullscreen immediately upon opening. I am not sure if we will be using this through a browser, or stand alone flash player, but I am not having much luck getting the fullscreen functionality to work.
Also, do to the high resolution, "if" I go fullscreen, will it scale to fullscreen? Or is there a way to do this? Those things being said, I tried a full screen script, however, I lost some functionality on two swfs that I load from external files within the deck is this normal? Or something I am missing.
View 1 Replies
Oct 16, 2010
The Idea is i want to make avariable that stores his value after i close the swf and open ti again,
an example:
i make acounter
var i:int = 0;
var timer:Timer = new Timer(1000);
timer.start();
[Code]....
the value of i will increase but after i close the application and open it again the value will return to 0 , keep the variable stores his value after closing the application ?
View 3 Replies
Jul 19, 2006
I'm trying to achieve something i thought would be extremely easy, but i can't get it to work!
[Code]...
View 1 Replies
Jan 10, 2008
I've searched around and wasn't able to find any solutions to my problem, which probably just means I'm going about this wrong way, but here it goes...I have a bunch of variables named like so:box0Wbox1Wbox2W
View 3 Replies
Jun 2, 2009
I'm having some problems switching from As 2.0 to As 3.0. How to make a variable trigger. in As 3.0? Lets say i have this on my time-line.
function onClick2(evt:MouseEvent):void{
var pagenumber = "pg03";
switch01.gotoAndStop("red");
gotoAndPlay (2);
}
How do I make a mc gotoAndPlay (_root.pagenumber) like we do in As 2.0?
View 6 Replies
May 14, 2010
I'm using a filter I got through [URL]. This filter provides a transition effect between images.
My navigation is a set of thumbnail image buttons that change a central larger image to match the particular thumbnail. The central image displays the image matching the last button clicked and the transition must be from that image to a new image matching the user-selected button.
What I would like is to be able to assign the first image in the transition to a variable. Can that be done with ActionScript 2.0?
My file: [URL](click on the red globe icon on the right to see the page (of flower images)).
View 1 Replies
Apr 8, 2009
if input_txt is correct name, you will be sent to right page, if wrong, then you get wrong name in my flash. I cant understand where i made wrong?
var word:String = input_txt.text;
function newsite(action:MouseEvent):void
{
[code].....
View 3 Replies
Jun 8, 2009
Trying to pick up a movieClip instance from my library and set it on stage and make it clickable, (dropdown/dropup) menu).
var MenuItem1:Array = new Array("text1", "text2", "text3","text4");CreateM(MenuItem1.length);function CreateM(Menu1:Number):void{
for(var i:Number=0;i<MenuItem1.length; i++){
[code]......
View 2 Replies
Nov 4, 2010
private var nsPlay : NetStream = main.media.nsPlay;When nsPlay changes,main.media.nsPlay should change accordingly;vice versa.
View 2 Replies
Aug 22, 2011
Can you have "ByRef" arguments in AS3 functions?
Primitive types in AS3 pass by value instead of reference. Is there a way to override that behavior and pass by reference for certain variables? [code]...
View 3 Replies
Jan 10, 2010
how do I make a global variable that can be recognized in all frames?
View 1 Replies
Aug 29, 2010
I'm building a website that is basically an art gallery. I have a movieclip that I'm placing dynamically Code:[code]This wall movieclip is basically a wall background image with artwork hung randomly at different sizes and locations... more of a collage vs a grid.I've manually placed the artwork mc's on the wall since it's such a random layout. Each artwork mc has an instance name of "art1" "art2" etc.I thought about trying to use xml, but since I'm not dynamically loading the thumbnails, I don't know how I would reference the thumbnail to the full size image?when you click on the mc "art1", make "art1" the value of the variable "currentArt" then look at the loaded XML and populate a DetailView_mc with:art1 info.[code]
View 2 Replies
Jan 23, 2012
I om trying to make one class with:[code]...
but i cant acess the var from class 1 with class 2. how could i make it a public var? ive tryed:
public var velocity;
and
var velocity:string;
make the var accessable for all classes?
View 0 Replies
Jul 17, 2009
I have a number of functions in my code that I want to be called from a List Component, epending on what the user selects from the list. I've added a number of cities to the list like this:
Code:
combo.addItem({value:"akron",label:"Akron, OH."});
combo.addItem({value:"albany",label:"Albany, NY."});
[code].....
View 3 Replies
Jun 14, 2011
Is it possible to use the Bindable compiler setting when using mxml?
I've got a string that I want to make bindable:
<mx:String id="myString">My Text</mx:String>
I could make it bindable in Actionscript, like this:
[Code]...
But it threw a lot of warnings-- other classes were already marked bindable in my App.
View 1 Replies
Jun 20, 2011
I'm trying to do that trick where you make a variable name with square brackets. I think I don't fully understand what I'm doing though...
Code:
var cursorDirection1:Point = pt.subtract(rootpos1);
var cursorDirection2:Point = pt.subtract(rootpos2);
var farShoulder:int = 1;//1 = left 2 = right
[Code]....
I'm trying to avoid having to do a conditional to choose between cursorDirection1 or cursorDirection2. My last line there isn't working, I'm not entirely sure why. Assuming farShoulder is 1, the code should be interpreted as
Code:
cursorDirection1.normalize(findNormVar(cursorDirection1));
but I'm getting errors about the input being undefined.
View 9 Replies
Mar 21, 2007
The fill function that I made works as long as you only need one color. How do I make a variable that will store the color? flash keeps giving me an error for trying to do it the way I am doing it.
Code:
fillit = function (d, e, f, g, color) {
color2 = "0x"+color
_root.lineStyle(1, 0x666666)
[Code]...
View 3 Replies
Apr 15, 2007
Why cant i make a variable in a function? like this:
aiBunny = function (target)
{
var target.hp:Number = 15;
target.interval = setInterval (aiFoe, 24, target);
};
View 3 Replies
Jul 24, 2008
simple code here, works just fine.
Code:
var myStyles:TextField.StyleSheet = new TextField.StyleSheet();
myStyles.setStyle("p", {color:'#808080'});
myStyles.setStyle("h1", {color:'#84ABDB'});
[code]....
Here is my problem - want to make a variable and put it between the style tags.
For instance:
Code:
var blah:String = "Hello there";
my_txt.htmlText = "<p>blah</p>";
Without it just writing "blah" I need it to get the string from the variable.
View 1 Replies
Aug 13, 2009
if its possible to make a movieclip to gotoAndStop on a certain variable, and whether or not you can decide which movieclip to go to also through a certain variable?
Code:
var frame:Number = 2;
var target:String = movable;
// movieclip named movable
[Code].....
View 1 Replies
Feb 9, 2010
I noticed that I can not find a way to make a variable accessible in more than one frame. My issue here is that for instance if I have a game and frame 1 has the game and frame 2 has the win screen and I want the win screen to display a score, I don't know how to do it. So the variable from frame 1 which holds the display can't be acessed in frame 2. I understand how to use OOP proggramming and classes, but you need an instance of that class to hold the variable, and It seems I can't cross-frame acess objects either. (I understand I could use a global variable, I don't know how to do this but I know most people don't.
View 4 Replies
Sep 2, 2004
Can I make a variable equal two movieclips? Like:
nav1 = _root.nav.nav1 & _root.map.map1;
And then run a function that would control both? Like:
function closeout() {
nav1.gotoAndStop(3);
}
View 6 Replies
Oct 27, 2009
I have an swf that plays a video (toobplayer component) and has two dynamic txt fields. The video and both txt fields are "fed" from an xml file. I also have a movie clip that loads an image on another layer and is set to an alpha of 0. Is there a way to use a conditional statement to check the video variable and if one is not present to change the image loading movieclip to an alpha of 100. here is what I am working with.[code]...
View 5 Replies
Mar 6, 2011
Some might know by know that I am working on a school project.But my knowledge of AS3 is not so big.My game is doing what it is supposed to do (for now).But the place where I declare (or something.It now looks like this:
Code:
public class game extends MovieClip
{
[code]......
View 2 Replies
Jun 9, 2009
Hey i am making a quiz which is going to have 20 questions and i have about 40 question in the questions array. make a variable which will hold the 20 random question so
for eg
var arrQuestion:Array = [ 40 questions in here separated by commas]
var randQuestions:int = arrQuestion.length-1;
but that just sets randQuestions to the arrQuestion's length now how do i set the variable randQuestion with 20 questions that are randomly picked from arrQuestion.
View 3 Replies
Sep 13, 2004
How do you make a variable have multiple answers attached to it?
example:
workPages = page2_mc, page5_mc, page6_mc, page7_mc
I tried this but it only used page2_mc and an array didn't work.
View 3 Replies
Jan 25, 2010
I would like to make a dynamic button on a website I am working on. I would like one button to update a variable, and another set of buttons to add 1 or subtract one from the variable I have buttons on the left side of the page for some bands that load conent into an empty movie clip.
The website: [URL]
I would like to set up some forward and backward arrows above that content on the right, so users can also scroll through the content in order. So if someone loads the content for soul asylum, and click the back arrow, it goes back to the Wailers, and if they click the forward arrow, it goes to Swollen Members. So there is an order of pages: 1. Wailers, 2. Soul Asylum, 3. Swollen Members, 4. Passafire, 5. Beats Antique, 6. SFM Kind of an order of importance. The idea is if somebody starts by clicking #3 Swollen Members, my application will know that it is on #3 and the arrows will go to #2 or #4.
Is there a way for the main artist buttons on the left to reset a variable for the current slide? So if someone clicks on the Swollen Members picture button, a variable called currentselection equals 3 And then when the forward arrow is clicked, it will ad 1 to the current selection and load movie #4
So in VB the main Swollen Members button would be something like: im currentselection as int = 3 Which would reset the current page as 3
Then the forward arrow would have code like:
Dim Nextselection as Int
Nextselection = & currentselection +1 & ".swf"
And the button in flash would be something like:
on (release) {
loadMovie("Nextselection", "rightcontent_MC")}
Which would load 4.swf the slide for passafire.
So how would I do this in action script 2.0?
View 0 Replies
Jan 22, 2003
I'm been having a bit of problem with Flash 4 and text variables. This is what I want to do: I have a blank title that I want people to complete: The (something) of the (something) (something) where people select words from lists to complete the title. I also want it to be centred on a mock book cover. The problem is that I can't work out how to make the whole title into one variable, which I can them place on the cover. Going by the tutorials I've seen, it should be something like:
[Code]...
View 5 Replies