Setting And Checking Variables
Bottom layer has 3 keyframes with (the same) 3 buttons in each. these make the main timeline switch between the 3 frames. But not just like that...
In layer above are 3 movieclips,.. 1 per (key)frame. These are the submenu's...
frame 1 to 15 fade-in (key)frame 15 is the usable submenu frame 16 to 30 are fade-out
Now the 3 main-timeline butttons should instead of just switching frames.. tell the menu to fade out first...
I avoided variables here by making several fadeouts of the same menu with different goto's at the end.
But here it comes//...
The Submenu calls on the real content... the fourth movieclip with the instancename SCREEN. And now the point is ... If this screen is active then i want to tell target THAT to fade out first before i just right away target the submenu.
I found out that if i press a button to activate the SCREEN i can in the same mousepress also SETVARIABLE 2 fields ... this i can stilll barely grasp.. but how i should check on the variable and then go do either this or that ???
I know the Setvariable is okay cause the other one only works in the timeline it is stated right ?
If you've actually read all this... THANX A LOT !!! really...
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-24-2003, 09:52 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Setting / Checking Variables
I don't know actionscript very well at all, but I know exactly what I need to do, and I know for a fact that it can be done. I'm just not sure how to write it out. Here's what I'm trying to do:
---
When the movie starts, I want to create a new variable on the first frame. Let's name it "sectionVar" just for the heck of it.
Now, later in the movie, there will be buttons to set this variable. If button 1 is clicked, then I want it to set the "sectionVar" variable to 1. If button 2 is clicked, then I want it to set the variable to 2, and so on.
Lastly, in a certain's frame actions (a frame that appears after the variable is set), I want it to check what "sectionVar" is set at, and perform an action according to the setting. For example, if sectionVar = 1, then gotoAndPlay(100). If sectionVar = 2, then gotoAndPlay(200), and so on.
---
Basically, I just need the coding to create a variable (in frame actions), set a variable (in button actions), and check what a variable is set at, and perform an action according to the setting (in frame actions).
Hopefully I explained this well enough, and if what I'm thinking it can do is completely wrong, then this will be a little embarassing, heheh. I'd really appreciate any help as soon as possible. Thanks!!
Setting And Then Checking Against Variables?
Hey there. I've been trying to figure out how I could somehow create an "if then" statement with variables for my website.
Basically I just want to have a button that checks for a certain variable when you click it (I want it to check if a movie, lets call it "movie1" is already loaded). If it comes back false, then movie1 and movie2 both get loaded.
This way, after movie1 is loaded for the first time, it wont be loaded again. Basically, movie1 is just my background for all my other movies. So clicking button1 for the first time would load movie1 and movie2. Clicking button2 AFTER button1 was clicked would only load movie3.
Got it? Problem is, I'm limited in my knowledge of actionscript and variables, so I need some help (actually, lots of help, as I dont even know where to begin) to get this working. Thanks!
Setting And Checking Variables
Hello, I am trying to create a game where when the "x" key is pressed it sets the value of a variable (acid) to 1. Meanwhile, a MC is checking to see if acid = 1 and if it does, it tells another MC to gotoAndPlay a certain frame. Here are my codes:
Frame 1 (Declaring the variable):
var acid = 0
Frame 1 (MC that checks Acid=1):
onClipEvent (enterFrame) {
if (acid == 1) {
_root.player_mc.gotoAndPlay("acidgun");
}
}
Code that sets Acid to 1:
if (Key.getCode() == 88) {
acid=1;
}
I need help fast! Please HELP! plz!?
Thank you in advance...
DV90
Edited: 11/22/2007 at 08:07:20 PM by DV90
Setting And Then Checking Against Variables?
Hey there. I've been trying to figure out how I could somehow create an "if then" statement with variables for my website.
Basically I just want to have a button that checks for a certain variable when you click it (I want it to check if a movie, lets call it "movie1" is already loaded). If it comes back false, then movie1 and movie2 both get loaded.
This way, after movie1 is loaded for the first time, it wont be loaded again. Basically, movie1 is just my background for all my other movies. So clicking button1 for the first time would load movie1 and movie2. Clicking button2 AFTER button1 was clicked would only load movie3.
Got it? Problem is, I'm limited in my knowledge of actionscript and variables, so I need some help (actually, lots of help, as I dont even know where to begin) to get this working. Thanks!
Checking Variables
I have four buttons in a movie clip, and i have an animation that plays on the main stage. I want it to play that animation, then based on which button someone clicked on go to a certain frame.
for everybutton i have:
on (release) {
set(click, "cd_bw");
_root.gotoAndPlay("wipe_box");
}
click being the variable that it's setting and "cd_bw" being the value. that's in the movie clip...
my if statement in the main scene is:
if (click="cd") {
gotoAndStop(15);
} else if (click="cd_bw") {
gotoAndStop(16);
} else if (click="ian") {
gotoAndStop(17);
} else if (click="tlg") {
gotoAndStop(18);
} else {
gotoAndPlay(19);
}
if i use numbers as the variables, it doesn't work, if i use text it doesn't work...i'm confused. Every time i click on something here it goes right to the 'else' frame. am i syntactically (is that a word?) wrong? or is it an issue with movie clips and actionscript.
thanks!!
~hodge
Checking Variables
What I want is for Flash to check a variable and then change a certain movie clip's colour depending on it's outcome.
This is my code at the moment:
PHP Code:
if (credit > 50000) {
Next I tried adding
PHP Code:
if (credits > 50000) {
}
.play(2)
And adding a different colour to the second frame of the movie clip, that didn't work so I tried.
PHP Code:
if (credits > 50000) {
}
.setRGB(603020)
And again nothing happened. Can anyone suggest what script I should be using so that if the variable credits is greater than 50000 a movie clip changes colour?
Checking Variables
Hi all!
I have a site currently in build, where I have 3 buttons on the main time line....that on(release) each set a variable (ie. button 1 sets panel="digital", button 2 sets panel="creative", button 3 panel="ebusiness".) Then they each trigger a separate movie clip to play until it reaches a stop(); (ie. click button 1...panel="digital"....digital movieclip plays)
Next when say button 2 is clicked....I want digital movieclip to play out and then make the creative movieclip to play in....but its not doing it?
On the last frame of each movieclip that plays out, i have a if-else if setup going which quiries the value of panel (the variable being set by each button on release)...but for some reason the if-else statements within the movieclips arn't picking up the value of panel set on the main stage?...although I know they'll work ok if the if-else statements were on the main stage.
This is what I have at the last frame of the movieclip:
if (panel=="digital") {
_level0.gotoAndStop("Intro", "digipanel");
} else if (panel=="ebusiness") {
_level0.gotoAndStop("Intro", "ebuspanel");
} else {
_level0.gotoAndStop("Intro", "paneloff");
}
Im all out of routes to try so any help is much appreciated.
Thanks in advance
Andy
Checking Variables
hey guys... i have a BIG prob with this action...
Code:
on(rollOver){
_root.mos.moluxo.gotoAndPlay("mouse_over");
}
on(rollOut, releaseOutside){
_root.mos.moluxo.gotoAndPlay("mouse_out");
}
on(release){
trace("before");
if(suites == 1){
stop();
trace("after 1");
} else if(suites==2){
trace("after 2");
if (desc==1){
suites=2
_root.descricao.luxo.gotoAndPlay("sumir");
_root.descricao.superluxo.mcsuites.gotoAndPlay("luxo");
} else if (desc==2){
_root.descricao.gotoAndPlay("superluxo");
}
}
}
it doesn't check the variables... when i click the button it only appears "BEFORE" and just that...
anyone can help me here???
Checking Variables
Hi all!
I have a site currently in build, where I have 3 buttons on the main time line....that on(release) each set a variable (ie. button 1 sets panel="digital", button 2 sets panel="creative", button 3 panel="ebusiness".) Then they each trigger a separate movie clip to play until it reaches a stop(); (ie. click button 1...panel="digital"....digital movieclip plays)
Next when say button 2 is clicked....I want digital movieclip to play out and then make the creative movieclip to play in....but its not doing it?
On the last frame of each movieclip that plays out, i have a if-else if setup going which quiries the value of panel (the variable being set by each button on release)...but for some reason the if-else statements within the movieclips arn't picking up the value of panel set on the main stage?...although I know they'll work ok if the if-else statements were on the main stage.
This is what I have at the last frame of the movieclip:
if (panel=="digital") {
_level0.gotoAndStop("Intro", "digipanel");
} else if (panel=="ebusiness") {
_level0.gotoAndStop("Intro", "ebuspanel");
} else {
_level0.gotoAndStop("Intro", "paneloff");
}
Im all out of routes to try so any help is much appreciated.
Thanks in advance
Andy
Checking Multiple Variables
i have a movie split into 5 diferent drag'n'drop games, each in it's own frame (2 to 6) and a blank 1st frame displays one of them randomly.
for each game i need to check if all the drag'n'drop objects have been dropped in the target areas, to tell the main movie to go and play the last frame.
how do i check multiple variables?
tkx ppl
Checking Multiple Variables
How would I write a script to check multiple varibles and if 0 return a answer of zero.
I have several varibles that are added to equal an answer... but if certain ones of them are zero the answer needs to equal zero and not the addition of the rest.
thanks nauhs
Question About Checking For Variables
Hi
i have this main movie, that loads an external swf into the mc Container.
The external clip stops at one point. Then when the user click a button, the transition plays, and at the last frame, it sets UnloadV = 1.
the problem
the button i have on the main movie has teh code:
on (release) {
Container.gotoAndPlay("transitionout");
while (_root.Container.UnloadV == 1) {
unloadMovie("_root.Container");
_root.Container.UnloadV = 0;
loadMovie("Social.swf", "_root.Container");
}
}
But i want the button to keep checking for the transition to fnish playing and the UnloadV variable to be set to 1.
How do i do that?
Thanks
Metal Fusion
If Statement Checking 4 Variables
For some reason, if any of the other variables are set at yes, and the bmi is still higher than 25.5 it will say diabetes no matter what. It looks like its only checking that one variable and nothing else...can someone please help, here is my code:
if ((_global.surgery="no") && (_global.hemophilia="no") && (_global.anemia="no") && (_global.bmi>="25.5")) {
_root.tests_one_txt = "Diabetes";
} else {
_root.tests_one_txt = "";
}
Passing & Checking Variables To/from Mc's
i have a problem with passing and checking variables(i think?)
please check my example swf file here:
http://ize.badne.ws/fatboy.swf
and my fla here:
http://ize.badne.ws/fatboy.fla
the right, hardcoded button works fine, but the left button which uses my function doesn't, i can just see the titlebar flashing for a second
the code for the moving/resizing is in the fenster mc as an onenterframe function
this is my function:
Code:
function MachFenster(id,woX,woY,breite,hoehe,titel){
if ("content" + id != true) {
_root.createEmptyMovieClip("content" + id, 1);
_root["content" + id]._x = -100;
_root["content" + id]._y = -100;
["content" + id]attachMovie("fenster", "fenster" + id, 1);
["content" + id]["fenster" + id]meMoving = true;
["content" + id]["fenster" + id]goalX = woX;
["content" + id]["fenster" + id]goalY = woY;
["content" + id]["fenster" + id]myWidth = breite;
["content" + id]["fenster" + id]myHeight = hoehe;
["content" + id]["fenster" + id]myTitle = titel;
["content" + id]["fenster" + id]attachMovie("title","title" + id, 1);
["content" + id]true;
}
}
and this is how the left button calls it:
MachFenster(1,300,300,300,400,"News");
i have no idea what's causing this, thanks in advance
Variables, Checking If A Variable = X, Please Help :)
Hi Guys (and ofcourse girls),
I kind of ran into a wall here.
This is my situation:
I have 4 buttons,
red button
blue button
yellow button
green button
I have 1 text field
The input of the textvield is a variable 'text input'
and I have a sqaure with a colored background.
My buttons change the variable of text input
on (release) {set ('text input', 'red');
}
, same for blue, yellow and green.
My questions is, is it possible to have a script to check "if text input = red then the colored background of the square will be red"
So I want to change the background color of my box depending on a variable basicly...
Thanks a mill
Checking Multiple Variables In One Go
Hi, I'm trying to create a random number generator ( Lotto lucky dip sort of thing) and wondered whether it's possible to check multiple vars in one if/ else statement i.e; Using Math.round(Math.random() * 49 + 1) 6 times to create 6 pseudo random numbers between 1 and 49 each passed to their own variable - ranNum1, ranNum2 etc.. I want to ensure each number is different. Is there a way of saying - if ranNum3 is not the same as ranNum2 OR ranNum1 then textfield = ranNum3.toString. else create new random number that is not ranNum1 or ranNum2.
Sorry if this is confusing but I've been trying to get my head around this for a while and it's starting to do my nut in.
Any advice. Am I urinating up the wrong tree?
If Statements Checking Variables ...not Working Please Help
I'm having the hardest time getting this to work, I have the concept of how things need to be put together, but the code is wrong. I can't even get the first if statement to work.
I have a menu that is going to be loading external swfs into an empty mc. It needs to check to make sure the external swf has gone through its stopping animation before loading something else. Here's what I've got so far... I hope this is clear enough...
button:
Code:
on (press) {
//check if this is the first mc being loaded
if (var_content_empty == true) {
_root.mc_content.loadMovie ("girl.swf");
//or something else is already loaded so stop it
} else if (var_content_empty == false) {
_root.mc_content.gotoAndPlay ("stop");
//check for when it's done stopping
//then load the new content
if (var_content_stopped == true) {
_root.mc_content.loadMovie ("girl.swf");
} else if (var_content_stopped == false) {
//not sure what this code is, should keep checking to see if it stopped yet
???
}
}
}
frame where button resides:
Code:
var_content_empty = true;
stop ();
first frame of external swf
Code:
var_content_empty = false;
var_content_stopped = false;
last frame of external swf
Code:
var_content_stopped = true;
I would really really appreciate some help on this, it's the last thing to fix and then my website is finished!
Loading Variables From Text File And Checking
hi
in script... how would i programm the script so that when i load a text file "notice_board.txt" and inside the text file it has "nb_checker=1" . how would i tell it to check if "nb_checker=1" then it will perform a command?
example ;-
*THIS IS NOT REAL CODING. AM GUESSING*
- Text file ( notice_board.txt )
nb_checker=1
- Action sctipt
LoadTextFile = notice_baord.txt
if nb_checker = "1"
gotoAndPlay(8);
else
stop();
Hope someone understands :P
Checking Full Loading Of Text File Variables
little question for you guys -
is it possible to check the loading of text file variables?
i have a whole lot that i load in one frame at the start of the movie:
loadVariables ("copy1.txt", "faces.dummy");
loadVariables ("copy2.txt", "faces.dummy");
etc...
but sometimes not all the variables are loaded when the user clicks the relevant button.
how do i guarantee the copy appears when needed?
thanks,
hed
[Edited by hed on 07-18-2001 at 10:51 AM]
Constantly Checking Variables In A Text File With Flash
I'm sure this problem has been encountered before, but I've been searching everywhere and can't find the answer I'm looking for. Hopefully someone can help me out -- thanks in advance!
My Problem: So I'm dealing with two frames. In one frame, the user fills out an HTML form. Submitting this form adds values to an external text file. In the other frame, I want to have a Flash movie that responds immediately (or within a couple of seconds) whenever a change is made to this text file.
What I know and have tried: I know how to read values from the text File and display them in Flash. The problem is that the movie only checks for variables when it is first loaded. I want it to check all the time (or every X seconds...) since users will be submitting the form several times in one session.
Any advice?
Checking For Object Code Variables Loaded Before Proceeding
I have some variables that get passed to my AS3 flash movie through the object code: (myMovie.swf?myVariable=xxx). My Flash movie is a single page of actionscript (package, constructor etc) single-frame movie. I recall in AS2 and before these sorts of variables often did not load right away and I traditionally had to setup a loop to check for the existence of variable values, and then allow the movie to proceed once the variables finally loaded.
How do I do this sort of thing in my new AS3 format. Do I need to concern myself with the load time for these variables? Is there a specific way to access variables that have been passed to flash through the object code?
I need to make sure the values for those variables exist before my code proceeds and I'm not sure exactly how to do that in this new structure.
Any help is appreciated.
Setting Variables
Hi, I'm having some problems getting variables to work. I have a movie clip and an invisible button which I am trying to make interact with that movie clip. I wish to make the movie clip play from frame 2 to 5 when it is rolled over. On rollout, it reverts back to frame 1. When it is clicked, it plays from frame 6 to frame 10, and stays on frame 10 until another action from another clip tells it otherwise, meaning no matter if you click it or rollover it again, whatever. I am unsure of which command to set the variable to activate. Here is my code:
on (rollOver) {
set (press1, true);
if (press1==false) {
_root.about_movie.gotoAndPlay(2);
}
}
on (press) {
set (press1, true);
if (press1==false) {
_root.menu1.gotoAndPlay(6);
press1 = true;
}
}
on (rollOut) {
set (press1, true);
if (press1==false) {
_root.menu1.gotoAndStop(1);
}
}
Setting Variables In URL
Hello All,
I am attempting at making dynamically loaded URL's for my dynamic buttons in flash mx. I have this issue: Is it possible to place a variable in the "URL" field of the "GET URL" browser function? If so, how? I have come up with the following code with no success.
Frame 1 actions
test = "http://www.google.com";
stop();
Dynamic button actions in Frame 1
on (release) {
gotoAndPlay(5);
}
Frame 5 actions
getURL("test");
stop();
I believe my problem lies in the "qoutes" around my variable "test" in the "getURL" field. I cannot remove them, flash puts them in there when I type anything in the URL field.
Any other suggestions on how to due this please reply.
Thank you
Steve
Setting Variables Right?
on (press) {
set (count, 1);
+count;
if (count>10) {
_root.gotoAndPlay("78");
} else {
gotoAndPlay ("64");
}
}
I think i did this right but I'm not sure, I'm new to AS myself.
I want the code to count the number of times you click on a button, but it doesn't see to be working.
I'd like it to play a specific part of the game(frame 78) if the button is clicked 10 times, but p[l;ay a different part(frame 64) if it's any less that 10.
Everything seems to work fine its just that when you goto click the button just once it restarts the movie. Any help?
Setting Variables? Again...................
Ok, this is my setup:
I press a button which both sets a variable frame (if i click home, frame = "home", if i click about,frame = about etc). The button also takes me to my transition out scene.
My transition out plays and the last frame says gotoandplay(frame)
My content frames are labled "home", "about" etc respectively so after the transition plays I should go to the right frame but I don't go anywhere.
Shouldnt this work? I thought so but my scripting isnt too good....
any help would be much appreciated
cheers
lev
Help With Setting Variables
I'm making a simple game and i wanna know how id make it so that when i click on a key (and make it dissapear by moving it's frame up by one, movie clip) and then click on the keyhole on a box it will change frames and appear to have opened
right now, if you click on the keyhole before getting the key it says "get the key first" but when i get the key it still keeps saying that
here in the code i have on the keyhole:
on (release) {
if (_root.lockedbox1 = 0) {
with (this) {
gotoAndStop(3);
}
} else {
with (this) {
play();
}
}
}
and this is what i have on the key:
on (release) {
lockedbox1 = 0;
with (key1) {
play();
}
}
can anyone help?
Setting Variables?
Hey, how would you use variables?
Completely nubish but yah... So am I..
But that's alright that's OK thats why I'm on this forum anyway
Setting Variables
Hi,
I have a quick question.
Okay I'm building this demo website, and I'm loading and unloading swf files as needed.
I ran into a small problem.
I have a Naviagtion (nav.swf), loading into _level3.
That I want to interactive with another (test.swf), in _level7.
In test.swf, it's a simple background change. My first background change is:
var bgImage = 0;
if (bgImage==0) {
_level7.bkMc.gotoAndStop(1);
}
This seems to work fine.
Now in my nav when I click one of my button, I want it to change the value to 1,2,3 etc....
So if I add the second part of it it will recongize the new variable and make the proper bk change.
var bgImage = 0;
if (bgImage==0) {
_level7.bkMc.gotoAndStop(1);
}
if (bgImage==1) {
_level7.bkMc.gotoAndStop(2);
}
So on and so forth. How do I do this?
I have been trying everything but I can't seem to find the right syntax.
Setting Variables In AS?
will someone please tell me how to assign variables in flash? I was guessing it'd be just like php but I think I'm wrong... I tried just $variable = blah; and then blah($variable); but it doesn't work
I'd be happy with just a link to a tutorial even..
Thanks for your time.
[F8] Setting Variables And IF Help
Hi,
I have two objects, two squares for example, square1 and square 2.
I'm trying to make it so that select just one and then you can rotate them using one set of rotate controls. Rotate controls consisting of 2 mc's to rotate CW and the other CCW. CW is rotateCW. and CWW is rotateCWW.
Code for the rotation (on frame) which makes square 1 rotate. But Here I want it so i can select it and then rotate it.
Quote:
rotateCW.onPress = function() {
square1.onEnterFrame = function() {
this._rotation += 3;
};
};
So I thought by making a Dynamic text box and calling it 'object' so when you click or roll over square1 or square two it changes the value inside it then you can apply an IF function to the rotation code above?
Code to set variable in Dynamic text box.
Quote:
square1.onRollOver = function():Void {
_root.object = "square1";
}
But I can't get this IF code to work. At the moment I have this
Quote:
rotateCW.onPress = function(){
if(_root.object = "square1")
{
square1.onEnterFrame = function() {
this._rotation += 3;
}
}
}
This does work, and makes it rotate but when you click the rotateCW. it changes the variable ('object') to square1 as well?
Any better ways or ways this can be fixed?
Thanks
(MX 04 Pro) Setting Variables For An Mc
What i need is to set some values for a few movie clips and then use them all at once. Eg, i'll have 5 mcs in my movie, each with either variable = 1 or variable = 2 etc assigned to each of them differently. Then i want to run some code kinda like
if (the variable on mc_one < 4){
do some stuff
}
Im not sure if im going about it the right way, but i think its fairly obvious what im trying to do. Thanks in advance for your help. Merry Christmas, Happy Hanukkah, Happy Sunday etc etc.
(MX 04 Pro) Setting Variables For An Mc
What i need is to set some values for a few movie clips and then use them all at once. Eg, i'll have 5 mcs in my movie, each with either variable = 1 or variable = 2 etc assigned to each of them differently. Then i want to run some code kinda like
if (the variable on mc_one < 4){
do some stuff
}
Im not sure if im going about it the right way, but i think its fairly obvious what im trying to do. Thanks in advance for your help. Merry Christmas, Happy Hanukkah, Happy Sunday etc etc.
Setting RGB Of Mc's Using Variables
Hey,
Just joined the forum here, but already i want to pillage your minds, apologies. I'm redeveloping the website at http://www.thebmbgroup.com. Different sectors of the company have difference associated colours. This is all crap you don't need to know.
What the problem is, when you click on different links in the main navigation, I am to be able to make various assets around the website change colour, according to an RGB value stored either on the mc holding the link or on my database running the site. For argument sake a i'll show some specific code:
onClipEvent(load) {
label = "Newmedia";
tipText = "blah, blah, blah";
myColour = "0xFFCC00";
}
Now, when we come to give certain assets this colour, how do we go about it? I'm trying various methods at present, here is my code at the moment:
fillColour = new Color(fill);
outlineColour = new Color(outline);
fillColour.setRGB(0xFFFFFF);
outlineColour.setRGB(parseFloat(myColour));
The problem I think I have, is that the setRGB needs a hex number argument, but I am presenting it with a string, does anyone with experience in this (or not) have any possible soloutions?
Thanks for your time and patients.
Cheers
John
Luton, UK
Setting The Value Of A Variable, Checking The Value Of A Variable
i think this might be a simple question, but I can't figure it out and it's puzzled me for a long time. If I set a variable OnRelease - let's say I have 4 buttons that set a variable to 4 distinct values, depending upon which button is pressed. How do I create a check, later, from another part of the movie, for what the current value of that variable is?
Is the variable universal - that is once it is set, the entire movie sort of 'knows' what the value of that variable is? Or do I have to direct the attention of the movie back to the same clip or frame or wherever I set it. Either way, what is the syntax?
I hope I was able to explain this and that it makes sense to someone.
Thank you!
-ml
Setting And Calling Variables.
I am more of an animator than a programmer--someone send me to a tutorial or somewhere that could explain how to do what I need to do.
If you click on my homepage link it'll show you my page. What I would like to do, is set up one button under the preview window, that will send you to the full page html link of the swf that is currently showing in the preview window--but this setting variables has me buggered. I've set the page up so that the buttons on the left load a swf in the "menu" area, and the thumbnails in the menu area load into a blank target movie clip on the root timeline.
Is there anyway to set a variable that would change each time a swf is loaded in the preview window, that I could call with the send button, that would take the viewer to the fullpage html page. The easy way would be to put a button at the end of each swf that could call the html--but I really don't want to have to upload all these files again.
I've had complaints from viewers that the title text is too small. You don't need to write the code for me, I am willing to do some homework--but I've been everywhere I can think of and I can't find anything that relates.
Setting Flash Variables
i was wondering if it was possible to set the _currentframe of an MC by using setting it like a variable???
like this
setVariable: "/mc:_currentFrame" = 5;
this particular code does not work... i was just wondering if anyone knew a way to do it this way... i'm not to skilled in flash4 actionscript
Trouble With Setting Variables
Hi All,
I thought I had the concept of variables OK, but there is a problem for me in one area.
In a game, (or anything for that matter!) I have a movieclip (meter) that contains a second movieclip (guage)whos _y position is increased by a certain amount, depending on what has been hit, this I am achieving with various buttons that have the code:
on (press) {
_root.meter.guage._y += (whatever value needed);
}
That works fine, however, I then want to:
a) display the new _y position of the second movieclip in a dynamic text box in the main stage,
b) set a variable with the new _y postition that can be used to ensure in the next scene the second movieclip (guage) starts in the place it was left by the previous scene, rather than starting back at the beginning position.
This is where I'm coming unstuck. I dont seem to be able to pass the variables around. I tried setting a variable in the _root, then sending it a new variable with an onClipEvent (enterFrame) on the second movie clip, but couldn't pass that to the next scene or to the dynamic text box.
Anyone see where my understanding goes pear-shaped??!!
Cheers,
Dongle
Really Easy, Setting Variables
hi
i have a bunch of variables in a php script that i need to load in my SWF in the first frame. each variable is a physical attribute of a particular MC. everything else works...right now my code looks like this:
imageMC._x = ixpos;
imageMC._y = iypos;
imageMC._rotation = irotation;
imageMC._height = iheight;
imageMC._width = iwidth;
it doesn't work though...am i writing the variable part right? let me know if you have any ideas! thanks!
Setting Color Variables...
Hello,
Is there a way for me to set a variable for color? I have a swf file with a variable. I am loading the data externally for the variable text field. The text field has a color applied to it in the Flash App itself through the text options palette.
Can I define the color for the dynamic text through a variable. If so, how do I set it up(in Flash as well as the external file)?
Thanks in advance!
Vince
Don't Know What To Call This, But Please Help About Setting Variables, I Think.
Hey,
I'm trying to make this thing, its like a secret code changer thing. For example if I type the letter a into the box i would like to be able to press a button it will output the message into another box as another letter. This would be like a secret code changer. I hope you can understand what i am trying to do.
If i type A into the input B will be printed in the output.
What code would i need to put on a button to do this.
Thankyou for your help and Happy New Year
-turner2000
Help With Setting Movieclip Variables
Howdy --
I have a movieclip on my stage, instance name Test.
The movieclip has a text field, called _TTest_.
I successfully modify the text field, a la:
_root.Test._TTest_ = "New Text";
Ok. Now, I want a bunch of duplicates of that movieclip.
for( i = 0; i < 10; i ++ )
{
sname = "test_" + i;
duplicateMovieClip( Test, sname, i + 100 );
}
When I do this, I can't seem to then modify the
text field in the duplicate movieclip.
If, in the loop, I do something like
_root.sname._TTest_ = "New Text" + i;
or whatever, well, that doesn't work of course.
I've even gone nuts and tried stuff like this:
var Tests = new Array;
for( i = 0; i < 10; i ++ ) {
sname = "test_" + i;
Tests[i] = new MovieClip;
Tests[i].duplicateMoveClip( Test, sname, i + 100 );
_root.Tests[i]._TTest_ = "test";
}
...which, of course, doesn't work.
I'm trying to modify text fields in duplicated movie clips,
how do I do that?
Any help would sure be appreciated, as I've run out of
crazy things to try...
THanks
Rob
Setting Variables Not Equal To Zero?
Ok, I'm kind of (totally) new to actionscript.
I've decided to try to learn on my own by blundering my way through a lifesim-style game. So far, so good... Until I tried entering variables that don't start out at 0.
("money"=200), etc.
The problem is, no matter what I set them at, the variables always start out in my game at 0. Also, at 0, they don't show up in the dynamic text boxes (they start showing up once I do something that gets them above zero, though... Just the number 0 doesn't show up.)
Any help would be really, truly appreciated, I'm trying to learn as much as I can on my own but occasionally I come to an obstacle I just can't get around... I've been trying to figure this out for 2 days now (I know, not a long time, but it's a major roadblock.)
PLEASE HELP ME!!!
Setting Variables Using A Button
Okay, here's what I need to have happen.
I have a picture album. When a button is clicked, I want it to give a certain value to a variable and then go play a movie clip of a "page turning", and then assign the movie clip an action at the end of the page turn that says if that variable equals "this", then go and play a certain frame in the main time line. Then different buttons will each play the page turn and then go to a different frame according to what variables I assigned them.
I seem to know what I want to do, and I tried it myself, but I'm not sure what I'm doing wrong. Here's my first code for the first button:
on (release) {
a = "1";
gotoAndPlay ("turn");
}
Then my movie clip of the page turn has this on the last frame:
stop ();
if (a=1) {
tellTarget ("/") {
gotoAndPlay ("Scene 1", "page2");
}
}
Can anyone help??????
Setting Variables From One Clip To Another
Hello, I have variables located at
Variable _level0.instance2.players0 = "Austin, Paula"
there are many players, this is just the first in the list. What I am trying to do is to take these variables from this movie clip instance and insert them into another movie clip
at _level0.data2. I am a tad confused about the correct syntax to make the variables available to the data2 clip. Could someone point me in the right direction?
Searcher
Setting Dynamic Variables
Lets say you load 2 variables from a text file named 500troom and 501troom. There's already a a variable called room that's set to 500. What I'm trying to do is make a text field that calls the values of 500troom or 501troom. The tricky part is that I need it to do it dynamically so that if variable room equaled 502, then the text field would call variable 502troom and vice versus when room equaled 500 then the text field would grab 500troom.
SO, in my head it looks like text field variable = room+"troom". But that spits out 500troom in the text field not the value of 500troom that was imported from the text file.
Hopefully this isnt confusing and someone can help me.
Setting Multiple Variables With 'if'
hi all,
I need some hlp here with some basic syntax...I know what I am trying to do, just not sure how to do it right...
I have an MC listening for a variable to be passed from a button on the main stage. I have it working with one variable, but not with multiple. In this case, it is a dynamic text box that I am trying to make display different files depending on the variable...here is what I have tried:
---------------------------
if (Number(_root.nav) == 1) {
loadVariables("1a.htm", this);
} else if (Number(_root.nav) == 1){
loadVariables("2a.htm", this);
}
---------------------------
seems to be not hearing the second variable for some reason...any help?
thanks!
-Damage
Trouble With Setting Variables
Ok, hopefully somebody can help me out.
I'm pretty new to actionscripting but i'm positive what i hope to accomplish can be done.
I'm trying to create a slide menu, which only allows one section to be open at once.
ie, if menu 1 is open and menu 2 is clicked then menu 1 slides closed then menu 2 slides open.
i figured the easiest way to do this would be to use a few variables to specify what is opening and already opened and use the variables to direct the timeline to various movie clip symbols based upon the variable values set by clicking on buttons.
Unfortunately, for the life of me, i can't seem to figure this one out, and everything i have tried doesn't play like i think is should.
So i guess my major question is how do i properly go about setting variables? and secondly, is this a feasible idea? i forsee the use of 2-3 variables total to get the effect.
any help would be greatly appreciated and suggesstions as well
thanks all!!
Latz-
Money
Setting Variables For Components
I've tried playing, or fooling, around with the combo box component and I still can't figure out how to set a variable for it. Can anyone help me?
|