ActionScript 2.0 :: Naming Frame Variables?
Jul 29, 2007
I created a slot machine and it works properly but i need it to do more. Currently when you spin the Reel, if you get any 4 of a kind its a jackpot. I need it so if you hit 4 "7's" lets say its different than hitting 4 "Bar's".On the main reel I have 4 frames with movie clips, each having a different (chip) and the end. I have set the random() function on them so it is completely random on how they hit. So my question is...how do I set a variable name for the frames so I know that frame 1 is a "bar", frame 2 is a "7", frame 3 is a "cherry" and so on. That way when I write the "if" statements, I can compare them so a "7" is better than a "bar".
View 2 Replies
Similar Posts:
Aug 31, 2009
Is it possible to dynamically name a variable? Like set a certain string as a variable name wouldn't think so but just in case.
View 2 Replies
Mar 25, 2010
If you have ClassA and ClassB, and ClassB contains a variable that references an instance of ClassA, what naming convention do you use for that variable in ClassB?I have used "classAReference" and "rClassA".
View 7 Replies
May 16, 2009
how I access variables in a frame on the stage with code from a frame within a movieclip?(basically passing variables from a stage frame to a movieclip frame)
View 4 Replies
Apr 25, 2006
I have a submit section on my flash movie.I also have 3 frames in this movie.
Frame 1:
Yes or No radio button
Comments: text field
[code].....
View 5 Replies
Oct 12, 2011
I have two varables 'number1' and 'number2', which is set by two movie clip symbols depending on the frame they are on (eg. Frame 1 for 'object1' sets 'number1' to 1, etc.). The frame is manually selected by the user. I have a third movie symbol 'object3'. When I click a button 'enter' I want to go to the frame number of 'object3' equal to 'number1' + 'number2'.
View 1 Replies
Oct 22, 2010
I use flashIDE(CS5) to create and organize my assets for flash game. Some movieclips need to have specific params.I am typing them at a MC's first frame:
var shape :String= "circle";
var material :String = "wood";
And then make them Export as MovieClip.For AS3 coding I use Flash Builder 4. When I create new Instance of this MC and trace values I get "null". But if before trace gotoAndStop(1); typed then my values are ok ("wood", "circle").
View 1 Replies
Apr 1, 2010
I have a Flash project with several labeled frames. The user will be doing a lot of moving about those frames, so I wanted to simplify my navigational interface code-wise. There are six buttons, I have attached functions to them like so:
Actionscript Code:
topnavbt.addEventListener(MouseEvent.MOUSE_DOWN,lookUp);function lookUp(event:MouseEvent):void {
[code]...
...instead, I get "TypeError: Error #1034: Type Coercion failed: cannot convert "skylights" to flash.display.FrameLabel."
I can't seem to wrap my head around what these errors are saying, but I'm sure there's a simple solution I'm missing. I think I just don't know how to define the frame label correctly.
View 2 Replies
Mar 18, 2009
are all variables written as global variables in Flash CS3? Is there a way for some variables just to work for some frames?
View 2 Replies
Jul 22, 2009
How would I go about transfering variables from one from to another?
What I want to do is send data from the first frame to a database then retrieve info back and populate form field on the second frame.
At the moment I have the code within the second frame doing everything! What want is to send the username and password enter in the first frame textboxes to a database then displaying the returned info on the second frame.
View 7 Replies
Feb 18, 2010
Well, I made a login page with flash and php. So I was wondering how can I make it so that I can send variables to another frame.
Like I have a button, when you press it, it connects to the database, and it checks your login. Then it gets all the variables. So how can I get the variables for every page on my flash project?
The only way I can think of now, is setting a dynamic text to the variable..
View 3 Replies
Jun 3, 2010
how do I access the variable from another MovieClip and frame? That's about the structure of the clip:
Layer1:ActionscriptA(Frame)
Layer2: MovieClip1+
-----------------|_layer2: BoneColor(MC) +
[Code]...
I tried to do this differently, for example
var clr:BoneColor = MovieClip1.BoneColor.ActionscriptB.clr
View 3 Replies
Apr 9, 2005
How do I pass the variable from a Frame to a Movie Clip. Is there anything special?
ie,
Frame 1-2 loop
number=3
I want to pass number 3 to the movie clip what should I use if the Movie Clip is in the same frame 1-2
View 2 Replies
Aug 4, 2003
t passing variables to another frame?
I have enterd the below code on a MC and would like the blob object in frame 2 to change the color I specified.
[AS]on (rollOver)
{
var Color1 = new Color(this);
Color1.setRGB(0x0000FF);
[Code]....
View 8 Replies
Jul 4, 2009
OK this might take a wile to explain but ill give it a go. I'm trying to make a sort f upgrade menu for my Flash game (AS2) but I'm a bit stuck. Ok my char has got this action script on it.
onClipEvent(load){
_global.speed = 1
}
onClipEvent (enterFrame) {
[Code]....
That all works fine but what i want to do is make it that when you click a button the var speed will change. I can do that quite easily with this code
on(press){
_global.speed += 1
}
and that works fine two but what i want to do is have the button for upgrading the speed on a different frame (ie. the upgrade menu)
So on frame 1 is the moving char and there is a button linking frame 1 to frame 2 (upgrade menu) and on that frame it has the button for upgrading the var speed and then a button linking frame 2 back to one but it doesn't work. I think i no why because on the char is says onClipEvent(load){ _global.speed = 1 }
so that means that the var speed will revert back to 1 when you go back to the first frame.
View 3 Replies
Oct 1, 2009
If we have declared some variables on a particular frame, say frame 20 in the actionscript coding window, can we use these variables defined on a frame in a class? Is there something like a global variable which must be declared to do this?The class extends to movieClip and it has been encapsulated by a movieClip which is then put on the stage to run it when the corresponding frame plays.
View 2 Replies
Dec 20, 2009
How can I trace a variable situated on the first frame in the scene. I mean from inside a movieclip how can i trace a variable nested in the scene? Maybe is not possible, I tried with trace(this.parent.MyVariable) but no success ...
View 3 Replies
Dec 1, 2010
I'm working on a dating sim (don't ask) and I already figured out most of the variables, but I have one problem. When the experience with one of the characters is a certain ammount, I want to play a different frame of dialouge.
Is there a way to play a new frame, only if the variable equals 10?
View 3 Replies
Jun 25, 2010
this is so complicated i don't think i'll ever be able to do it a button is clicked to start the game which is all playing in the second frame of main timeline according to the maths for as3 but i need to be able to have the same button in the same frame when clicked gotoandplay an mc which exists in frame 3
View 9 Replies
Oct 27, 2009
Got some external classes, say MyClass.as MyClass.as has a static variable called foo
So, ordinarily in other AS files I can call this with MyClass.foo = bar;
However, this seems to be different in timeline scripts. Every time I try this I get the reference with a static type error 1119: Access of possibly undefined property foo through a reference with static type flash.display:DisplayObjectContainer.
I've tried doing an import MyClass, etc... nothing seems to be firing.
View 1 Replies
Jun 14, 2011
I am very new to Flash AS3 and Flash Professional CS5. What I am try to do is show frames 4 to 10 (it just say CORRECT in bold) when a user selects the correct answer.On Frame 10 I have the code say "gotoAndPlay(2);", the problem is on Frame 2 I have action-script on that page and all my variables are re-declared and they all get reset as Frame 2 is loaded.How should I prevent the variables from being reset each time frame 2 is reloaded?
View 5 Replies
Aug 18, 2009
I have 2 buttons in a flash movie with the following codes. They open a new URL that also contains a flash movie and it sends the variable "nFrame" and a value.
Button1:
Code:
on (release) {
getURL("goats.html?nFrame=1");
}
Button2:
Code:
on (release) {
getURL("goats.html?nFrame=2");
}
When the new URL opens I want the flash movie to begin at a particular frame depending on what variable "nFrame" is equal to. I tried placing this code in the first frame to do it but it didn't work, the movie just loops and loops and doesn't stop at any frame.
Code:
if(nFrame=1) {
gotoAndStop("cheese");
} else {
gotoAndStop("wine");}
}
View 1 Replies
Sep 16, 2010
In my flash program I have everything on one frame. In the actionscript on that frame, I made a variable called currentButton and set it to the first button, to keep track of which button is currently pressed. In the click function this variable is changed to whatever button was clicked.Now, I didn't think this would work, because seeing that the one frame is being played over and over, (there's no stop() command in there) I thought currentButton would keep being reset every frame. To my surprise, it worked just fine. Not that I'm complaining, but I'd like to know why it's doing that. Shouldn't all the code on the frame be done every time the frame is played, including the part that sets currentButton to button1?
View 4 Replies
Apr 7, 2011
I am trying to create an AS3 Fla to score a quiz's results. The quiz is a separate swf that stores its results to a shared object ("G1"), and both the quiz swf and this new scoring swf would reside on the same website.
I've tried scripting the AS3 in the new scoring Fla but I keep getting error messages.
So far, here's what I have that doesn't work.
[Code]....
The goal is to open the scoring swf, populate some variables with the values from the SO, then (not yet tried in the script) apply some if/else conditions to show specific results based on scores.
View 3 Replies
Jun 28, 2011
I have written some code to read and compare variables and then to jump to a particular frame based on the results (pretty simple stuff). It works fine when I use a button to trigger the code but I want it to happen automatically.
I have tried using the OnEnterFrame thingy but it doesn't work and I tried just placing the code on frame 1 and letting it do its thang but that didn't work either....
I'm using the .swf in a third party program and using the API for that program to supply the values.
here is the code:
_parent.InitializeExternalVars();
var m_varStrEndSlide;
function display(){
[Code]....
View 0 Replies
Aug 26, 2009
Code:var StringMine:String = "hello";And i want to use the value of that string, 'hello' to name a new variable, i thought like this,Code:var [StringMine]:String = "One";but not supprisingly, it doesnt work...
View 2 Replies
Mar 11, 2010
I thought that there was a way to be able to name array indexes. Like instead of myArray[0], it could be myArray["tileFour"]. I thought that instead of using index numbers one could use index words.
View 1 Replies
Jul 25, 2011
i have an array of coins that are layed out on a map for a character to come pick up.i have the coins displaying on screen but i cant get a simple hit test to work. it only seems to work on the last coin created, i presume because the 'i' value hasnt been appended to the name. i knew how to do this in as2 but dont know the syntax for as3. ive attached the file for you to have a look at.
code:
rectangle_mc.startDrag();
rectangle_mc.x = mouseX;
rectangle_mc.y = mouseY;
[code]...
View 4 Replies
Dec 13, 2009
loader is display object but I could not set name to loader. In the documentation loader does not have property of "name". How to set name for loader instance. Example
var imgColl:Array=new Array("1.jpg","2.jpg");
var i:Number=0;
while(i<tot){
[code]....
View 2 Replies
Aug 8, 2011
is it possible to add variables and name them according to position in a loop? for example how can I do something like this:
[Code]...
View 5 Replies