Changing Variable?
Hello all.
Is it possible to change the vriable of a dynamic text field. Here is what I mean.
my text field variable is called q1. I need to be able to change the variable to q2 then q3 etc.
this text field is a question for a quiz recieving data from a text file. so for the first question the textfield will recieve the q1 variable from the text file. then I want to be able to click a button and change the same text field to recieve the variable q2 from the text file. is this possible?
Thanks in advance
felix_man
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-16-2002, 05:19 PM
View Complete Forum Thread with Replies
Sponsored Links:
Changing Root Variable With Text Variable
Simple question: I'm trying to change the value of a variable on the _root level (called "myVar") to whatever a user types into a text box (mytextvar) on the stage. I have a button that says:
ActionScript Code:
on (press) {
_root.myVar = _root.myTextVar;
}
It isn't working... any ideas how to make this work?
View Replies !
View Related
Changing Value Of A Variable
I've got a strange problem. I'd like to change the value of a variable that is inside a Movie Clip from the main scene and from another Movie Clip.
Does anybody know how to refer to that variable?
SCENE
/
Movie Movie
clip clip
with the that change the varible
variable on the other clip
Hope this draw helps =]
Arquidruida
View Replies !
View Related
Not Changing The Value Of The Variable And I Don't Know Why
I have a variable on the main timeline called 'active'. I set it's value in frame one of the _root timeline to:
active = "none";
I have a movie clip on the main timeline, instance name "01", with a button inside of it that has the following action:
on(press){
_root.active = this._name;
}
The value of the 'active' variable on the main timeline SHOULD be "01" right?? Well that's what I thought, but it doesn't!
I've tried everything: I put a stop(); action in frame two of the main timeline to make sure that the movie wasn't looping and reseting the value of 'active'; I changed the name of the MC to a name that didn't contain any numbers; and everything else I could imagine!
I swear I've done the same thing in the past. It just won't work and it's driving me crazy!!!!!! arghhh!!!
Can anyone help? Oh yeah, I've tried it in Flash 5 and MX and neither works.
Thanks,
Justin
View Replies !
View Related
Changing To A Variable Name
Ill just give an example of what I am doing below.
I have a variable which can change, lets call it myname
I also have variables in the format mynametype
Now the myname variable can be for example ted, phil, or mike
What I want to do is use the myname variable add "ver" to the end of it but kep it as a variable name.
For instance lets say myname = ted and tedver=3
I want something like trace(myname+"ver")
But instead of returning the string mynamever, or tedver as my code example would, I want 3 to return from the trace because thats waht tedver equals.
working on it myself I have raised the question is there a way to convert a string to a variable name.
what i did was
varname=(myname+"ver")
so in the case of myname=ted
varname=tedver
but this is a string and not a variable name. Maybe I am just pulling at straws but i think im closer now, hopefully someone can help me the rest of the way.
Thanks for the help.
View Replies !
View Related
Changing A Variable Name
var fish:Number = 2;
for (i=1; i<=fish; i++) {
var xdir:Number = Math.random()*100;
var ydir:Number = Math.random()*100;
if (xdir<50) {
_root.fish_(i.valueOf).xspeed=5
} else {
_root.fish_(i.valueOf).xspeed=5
}
if (ydir<50) {
(fish_(i.valueOf())).yspeed = -5;
} else {
(fish_(i.valueOf())).yspeed = 5;
}
}
The part that isnt working is the value of part, im trying to make it so that the loop adresses both fish by changing the name of the variable.
So there is fish_1 and fish_2 and i want to loop twice and pick either negative 5 or positive for x and y speed but how do i change the name of the variabel fish_...???
View Replies !
View Related
Changing A Variable
once again. i'm totally new to actionscripting, so i appreciate your patience.
let's say i have a variable called A with an initial value of 0
if i wanted to click on a button and have that button give the variable A a value, what would be the best method to go about doing that?
View Replies !
View Related
Changing Value Of Variable In Mc From Another Swf
Hello everyone, I have one swf file that containes a mc using an easing function to move an arrow around. That mc has the instance named myruler. The arrow moves based on the value of a variable named "y". This swf also has a mc that I use as a container to load movies into. The movies that are loaded into the container mc have buttons that I would like to use to change the value of the variable "y" in the movie clip named myruler found in my base swf. Did that make sense? The code I'm trying to use on those buttons goes as follows:
on(release){
_root.myruler.y = 300;
}
The my ruler movie is in the swf that loads the swf with these buttons. So how do I point to that original swf.myruler.y? Thanks in advance!
View Replies !
View Related
Changing The Value Of A Variable
i've been working on a game for a couple of days, and there's one part i'm stuck at.
i'm trying to have it so that when you push <space> the value of the shields (variable is shiphealth) goes down one, and one of the lights turns off... i'm not sure how to do this, i tried entering:
ActionScript Code:
on (keyPress <space>) {shiphealth = shiphealth-1}
but it does some erratic movements of the lights...
the fla is attached
plz help
thanks
View Replies !
View Related
Changing A Variable Name
Hey, I'm currently working on making a side-scroller and came across a problem when scrolling tiles.
I use an object to hold information and an mc
Is there anyway I can change the variable name of an object or movie-clip?
Reason: I want to be able to access certain tiles from the scroller quickly by using the x&y coordinates of the tile.
ie:
Code:
var obj:Object = new Object();
for(i = 0; i != 10; i++) //x-coord
for(j = 0; j != 10; j++) //y-coord
obj["_"+i+"_"+j] = new MovieClip(); //accessing obj's mc using coordinates
Then later when I want to move a particular movie-clip over to represent a new tile on the screen, I just move a previous unneeded tile over so that I won't have to delete the old one and create a new movie-clip and fill it with information. But the problem comes in this. I can't change the obj name to anything else when it becomes a new tile with coordinates i and j, I can't access it by going obj["_"+i+"_"+j] anymore. I have to use it's old name obj["_"+oldI+"_"+oldJ].
Does anyone have a way around this? Maybe my way of storing variables is bad?
I hope my explanation was clear.
Thanks much,
Fydus
View Replies !
View Related
Changing Value Of Variable In Mc From Another Swf
Hello everyone, I have one swf file that containes a mc using an easing function to move an arrow around. That mc has the instance named myruler. The arrow moves based on the value of a variable named "y". This swf also has a mc that I use as a container to load movies into. The movies that are loaded into the container mc have buttons that I would like to use to change the value of the variable "y" in the movie clip named myruler found in my base swf. Did that make sense? The code I'm trying to use on those buttons goes as follows:
on(release){
_root.myruler.y = 300;
}
The my ruler movie is in the swf that loads the swf with these buttons. So how do I point to that original swf.myruler.y? Thanks in advance!
View Replies !
View Related
[as1] Changing Variable Name
Hi guys,
I'm passing a variable from php to flash, I'm kind of new to php so maybe there is a simple solution.
Anyway my problem is this, the variable name is a reference to an image and It's the whole path like "c:uploadsimagesimage.jpg" what I want to know is if there is any way that in flash I can extract just the name "image.jpg"
I hope you can understand my terrible english
thanks
View Replies !
View Related
AS2 - Changing A Variable
This may seem like simple fix, but i cant seem to find it.
I have a movie that uses a variable to hold the background image name.
I am loading anoother movie in a container. I want to create 3 buttons that when clicked changes the varibale name in the first movie to set it to a different background image name.
do i use the set method?
any help would be awsome....!
View Replies !
View Related
Variable Not Changing
ok, I have a button that changes a variable (a url for a jpg). The variable is declared on the root timeline and then is used so that when you click on a picture, it will go to a page displaying the thumbnail inside of a movie clip(loadMovie);
this is what i have on the root:
Code:
var movie:String = "blah";
this is what i have on the button:
Code:
this.onRelease = function(){
this._parent._parent.gotoAndStop(2);
_root.movie = "photos/pic1.jpg";
}
and this is what I have on the thumbnail page:
Code:
stop();
loadMovie(_root.movie, this.enlarged);
trace(_root.movie);
when i trace the variable its still equal to blah... doesnt make any sense..[/code]
View Replies !
View Related
Changing Variable Colour?
Is it possible to chage the colour of a variable and even better parts of it!
for example can the variable text read
hello (in blue) this place is (in black) GREAT! (in red)
then have it changed to
hello (in red) this place is (in blue) GREAT!! (in black)
it was just something i was thinking of and thought it could only be done in AS.
Thanks people!!
Danny
View Replies !
View Related
Changing Variable Values...
I have a drag and drop navigation...
whenever i release, 2 variables will be updated: prevX and prevY.
Its works...that is before i declared a value for these 2 variables when the scene loads. (i placed it in a frame script)
After i did that, the values will not be updated on event,
instead the values remain.
What should i do??
View Replies !
View Related
Changing Variable Across Levels
I have a menu that loads on level 999. i want to change a variable on level 0.
For some reason, i can't seem to be able to change the variable from another level.
I am basically using:
_level0.variable="this";
Anyone know what i am doing wrong?
Thanks.
robert
http://www.isafoto.com
View Replies !
View Related
Changing The Variable Name Of A Textfield?
Hey everybody. I was hoping if someone could help me out with this. I have a textfield named "text1" that is assigned a variable. I need to change this variable at a certain point to something else. I'm using MX and I know that they have the command "TextField._variable", which assigns a textbox a certain variable.
What I did, I created a button instance and assigned it the action:
Code:
on (release) {
text1.TextField._variable = "Display";
}
However, this is not changing the variable to "Display". Anybody know what I'm doing wrong? I'm not all that good with actionscript so I prolly might have some simple error.
View Replies !
View Related
Dynamicly Changing A MC From A Variable
hi,
I want to get a variable out of a database, put it in an xml file and change the size of a movie clip based on that variable.
can anyone help me w/ the flash portion of this? I've found a few tutorials but they are far more complacated then I need.
so my xml file will have a given number, say 77.
I have a MC called Grower.
I want the MC to slowly change from 5 pixels wide to 77 pixels wide.
I think the syntax would be something like;
grower.width=grower.width + 5
do until grower.width >=77
does that make sense? I'm just not real sure of the syntax and how to get it from the xml page.
Thanks for any suggestions.
View Replies !
View Related
Automaticly Changing Variable
Hi,
I made a guessing game.
You have to guess a number, when your guess is too big, it says too big and when it's too small it says too small.
But now, the number I choose is constant.
I want when you got the message correct (when you guessed it right)
the number has to change.
Here's the actionscript :
on (release, keyPress "<Enter>") {
if (in1 == "6") {
in2 = "correct";
}
if (in1 > "6") {
in2 = "too big";
}
if (in1 < "6") {
in2 = "too small";
}
}
in1 is the input field for the number and in2 is the dynamic output where the message appears correct, too big or too small.
I guess I need to make the number 6 a variable that changes when correct has loaded into in2.
But can anybody tell me how I can do that ?
Thanks in advance
Greetings
Camme
View Replies !
View Related
Changing Variable Placement
I'm just getting started with Flash 5 and have read thru the book "Special Edition: Using Flash 5", but am still confused about a couple of things (lots of things actually, but will address only a couple for now).
Context: Designing an RPG
Info: I have lots of variables (numeric values) that will be changing frequently. My thoughts were to load default values for all necessary variables in the first frame.
Question 1: Will I be able to manipulate these values from different scenes? movieclips? i.e. call the value, change it and call the variable with the new value from elsewhere in the movie.
Question 2: In manipulating the variables, which method would be fastest and require less space FUNCTIONS or MOVIECLIPS?
Question 3: Are there any limits to the number of variables and/or functions that can be applied to a single frame?
Thanks for your help!
View Replies !
View Related
Changing Text In A Variable
whats the best way of being able to change a word or words in a variable, ie. "the quick brown fox" to "the quick purple fox". the brown could be in any position, and the variable could be any size.
any suggestions would be greatly appreciated
Cheers
Fozzybear
View Replies !
View Related
Changing The Variable To Use In A Calculation
First things first, I need to tell you what I'm doing/have done. I'm using Flash 5 to do an electronic character sheet for D&D 3.5. I already built one for 3.0, but it looks like crap when you print it without PDFing it first. You fill in the basics, like the ability scores and their modifiers, and anything that ends up as a calculated stat (like Armor Class) is derived from whatever you enter. For instance, total skill modifiers are the relevant ability bonus + the number of ranks + the miscellaneous modifiers (as you'll see below). Everything updates dynamically on the sheet.
However, I've run into a bit of a snag. You see, when an ability score gets altered by something, such as a curse or a magical item, my intent is to have the altered score be listed under the Temporary Score/Temporary Modifier boxes. This is something I didn't think of with the previous sheet, so I'm in unexplored territory now.
I'm trying to create a new variable for each ability score called Cur[Ability]Mod. I want to set it to the temporary modifier if, for instance, TempStrMod isn't blank. Flash seems to draw a distinction between blank and not-yet-defined. The way I can tell it doesn't work the way I'm doing it is that when I enter a value in the Strength Modifier field the modifier for, say, Climb doesn't change. However, when I enter a value in the Temporary Modifier field it changes. If the TempStrMod field doesn't have anything in it CurStrMod should be set to StrMod instead of TempStrMod. Instead, it only wants to take the TempStrMod value. Here's the code for setting the value of TempStrMod:
if (Number(_root.TempStrMod) != "" && Number(_root.TempStrMod) != undefined) {
_root.CurStrMod = Number(_root.TempStrMod);
} else {
_root.CurStrMod = Number(_root.StrMod);
}
…and for setting the value of a skill modifier, in this case Climb:
_root.ClimbSkill = Number(_root.CurStrMod)+Number(_root.ClimbRanks)+N umber(_root.ClimbMisc);
Do I need to find some web hosting so I can post the FLA file? I know this all sounds a bit complicated, especially if you can't see what it's doing (or, rather, not doing).
View Replies !
View Related
Changing Variable Values
Im trying to make simple poll in flash where it changes the value of the variable in the results textbox using Load Variables like for example &text=0, then i would use post in load variables to change the value of &text=0 to &text=1 with out me having to update it manualy, if this is possible someone please help me and explain to me how to do this.
heres a link to the file
PS its only a test meaning i just want this part to work for now.
View Replies !
View Related
Changing Pictures When A Variable Changes
I have a counter that starts at 10. Whenever you click on the screen it goes down by one. I want a movie clip I made with 10 little markings to change everytime the counter goes down. Each frame in the movie clip is has the next amount of markings and I have stop(); on each frame. then I have
if(count==9){
goToAndStop(2);
}
if(count==8){
goToAndStop(3)
}
etc...
The counter goes down fine, but the picture doesnt change.
View Replies !
View Related
Changing The Variable Names
Hiya everybody!
Does anybody know how to change the variable name of a dynamic text box by the click of a button.
So If I click on buttonOne - the variable name on the dynamic text box changes to "buttonOne".
If I click on buttonTwo - the variable name on the dynamic text box changes to "buttonTwo".
All help much apprecitated
Deadhands
View Replies !
View Related
Changing _alpha With A Variable. Ack Help
Hey there.
I am trying ot do somethign pretty simple (in Flash MX Prof. 2004), I am making a preloader that makes the instance preloaderLogo go from 0% opaacity to 100% based on load progress. Easy enough, but there must be something wrong with my code here cause it won't work. Can anyone help me out? thanks!!
PercentLoaded = _root.getBytesLoaded() / _root.getBytesTotal() * 100;
preloaderLogo._alpha = (Math.round(PercentLoaded))
if (PercentLoaded >= 100) {
gotoAndStop("start");
} else {
play();
}
View Replies !
View Related
Problems With Changing Variable
If someone could look at my file and see the scripting theres 3 action places one on the first frame one on the second and one on the button placed in the movie.
Its a really simple test but its not working for me.. should be pretty easy to see what Im looking to do.
Someone please tell me what Im doing wrong!
Thanks
Oh and by the way.. Im using flash 4
View Replies !
View Related
Function With Changing Variable
hi
it is to late to change this in my project right now, but for future project i'd like to know the following:
i have a button, which should change several movie clips. so i had the button change a variable. the other mcs then check the variable and do whatever procedure is "attached" to that state of the variable. so most of the time if i push a button the following happens: the mcs are doing something with the old state of the variable, then the variable changes and they do something with the new state. my "problem" with that is, that i can't make one funtion out of it, because in the middle of the process the variable is changed to the one specific number that only that button will it give it. so i have to do a function for what happens before the change of the varibale, then change the variable, then have another function for what happens after the change.
is there a solution to that problem?
thanks
Robert
View Replies !
View Related
Button Changing A Variable Help Plz :D
Hey all
Let me apologise in advance if this has already been covered but i am new to these boards and after looknig through some of the great tutorials i decided to sign up
Anyways i have three buttons on the title screen, easy medium and hard. Each difficulty will control the speed of the ship flying past. The variavle i am using is called "speed". I have the action script working when it comes to making the x and y coords movement depend on the value of "speed" but what i cannot do is code so that when the button is pressed the speed value changes depending on the button pressed
easy = 10
medium 20
hard= 30
The buttons and the ship are on different scenes
Buttons are on scene 1 and ship on scene 2
If anyone can help i would be greatly appreiciative!
thanks!
View Replies !
View Related
Dynamically Changing A Variable?
Hello all,
I am working on a project that is an existing HTML page that searches for realtors in your area. My job is to create a flash pop-up that appears when you click "more info" next to each realtor. This pop-up will contain more information about the realtor (phone, web address, location, etc.) I have the pop-up completed but here is my dilemma. Below is the variable I created that contains the URL to the XML file. Of course the "more info" link will point to a different URL for each realtor and I am not sure how, or if it is even possible, to "update" this variable below to the appropriate URL. Is it possible to have this variable change "on the fly"??? Thanks in advance.
Code:
var xmlFile:String = "http://www.website.com/Resources/GetAgentMarkerDetail.aspx?id=138595C-3735
";
View Replies !
View Related
Changing Variable In Parent Swf
I have a variable PLAYMOV defined in mc1 a movie clip on the main timeline. Playmov is to hold that variable name for the next swf to play in the movie clip thumbs_mc.mc0.
ActionScript Code:
playmov = '';
// assign event handlers (called when all swfs are loaded)
function setupHandlers() {
filetext= "all loaded"; // don't need loading indicator any more
playmov = thumbs_mc.mc0;
playmov.gotoAndPlay("intro");
}
// code for menu button to play the exit sequence of the current swf and then change the "new current" to another swf
menu2.onRelease = function() {
playmov.gotoAndPlay("exit");
playmov = thumbs_mc.mc1;
}
This all works fine, the exit code on the button also works. The problem is on the last frame of the "embedded swf" i have the following code to make the next named swf play... for some reason this code is not working... any ideas? Am i referencing the parent timeline incorrectly?
ActionScript Code:
_root.nav_mc.playmov.gotoAndPlay("intro");
View Replies !
View Related
A Changing Static Variable - ?
This is very strange, and confusing me. The explanation of this problem involves a lot of code that I won't be showing, but suffice it to say, I'm not doing anything overtly absurd.
So I was adapting and rewriting my own color matrix calculating class, which takes inputs for hue, saturation, etc.. and calculates them out into a unified matrix, and you then you use that with a ColorFilter to get the visual affect you want.
So here is a static used in the class:
ActionScript Code:
// An identity matrix for a ColorMatrix
private static const IDENTITY_MATRIX:Array = [1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0];
now the init code..
ActionScript Code:
// Constructor
public function ColorMatrix() :void {
reset();
trace("init: " + IDENTITY_MATRIX);
}
public function reset() :void {
_colorMatrix = IDENTITY_MATRIX;
_saturation = 1.0;
_contrast = 0.0;
_brightness = 0.0;
_hue = 0.0;
}
Now.. All of this code works perfectly fine in 1 instance. But create a second instance of this class, and I start getting weird results.. which lead to me finally tracking it down as this:
(first instance)
[ColorMatrix] - new instance instance5
init: 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0
(second instance)
[ColorMatrix] - new instance instance10
init: -0.5746579999999999,1.43032,0.1443380000000001,0,0, 0.425342,0.43032000000000004,0.14433799999999997,0 ,0,0.4253419999999999,1.43032,-0.8556619999999999,0,0,0,0,0,1,0
Eh? How, exactly does one change a static const? But more importantly, what is that matrix? Well its the change operations I've performed on the first instance, showing up as the identity matrix for the second instance!
Do I have some sort of cloning error? I'm utterly at a loss as to how this is happening. Of course, if I change my code from
ActionScript Code:
_colorMatrix = IDENTITY_MATRIX;
to
ActionScript Code:
_colorMatrix = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]
it works perfectly. So uh.. what gives, static const variable.. isn't... staying.. as..*passes out from loss of braincells*
View Replies !
View Related
Changing A URLRequest Variable's Value
This is my first real stab at doing something in AS 3.0, I am trying to content from external SWF files, but am unsure how to properly change the URLRequest variable's property. (There isn't only one button, this will be done for each in the navigation of the site)
Any Help is Tremendously Appreciated
Thanks,
Roger
ActionScript Code:
import flash.events.MouseEvent;
//---Creates the Variable for requesting content----\
var request:URLRequest = new URLRequest("right.swf");
//---Actions for the first Button---\
video_btn.addEventListener(MouseEvent.MOUSE_UP,goVideo);
function goVideo(evt:MouseEvent):void {
//---Here I believe I need to change 'request' variable to "video.swf"---\
gotoAndPlay(33);
}
//---This is just a return button---\
right_mc.back_btn.addEventListener(MouseEvent.MOUSE_UP,goHome);
function goHome(evt:MouseEvent):void {
gotoAndPlay(57);
}
//---This actually loads the content---\
var loader:Loader = new Loader();
loader.load(request);
right_mc.loadRight_mc.addChild(loader);
View Replies !
View Related
Problem With Changing Variable
Hi guys
long road to this workaround since I can't get a switch to work. What I want to do should be easy...should
I have MC on the stage called "blankMC".
I want to assign it the var name "currentMC"
I call a function that adds another MC,"aboutMC", to the stage through addChild(aboutMC).
I want "aboutMC" to now be the "currentMC".
This is so I can remove the currentMC with antoher funcion
Whatever I try and trace returns [DisplayOBject] as the currentMC.
I'm sure it is something basic
should I try and assign a string vale to the MC?!?
Thanks alot
View Replies !
View Related
Changing Variable Names Throughout A FLA?
Just had this thought cross my mind, wondered if it was possible:
If I wanted to change the name of a variable that is referenced multiple times throughout a FLA by multiple things, would I have to go through every single line of code to search & replace it, or is there a more global function that will allow me to change the name throughout the whole FLA?
Just curious.
View Replies !
View Related
Changing Variable Names
Changing the Vaibles names
Hiya everybody!
Does anybody know how to change the variable name of a dynamic text box by the click of a button.
So If I click on buttonOne - the variable name on the dynamic text box changes to "buttonOne".
If I click on buttonTwo - the variable name on the dynamic text box changes to "buttonTwo".
All help much apprecitated
Deadhands
View Replies !
View Related
Changing A Variable In An External Swf
Hello!
I am working in Flash cs3 with actionscript 3.0.
I want to create a swf that will act as my client's control panel. What i'm looking for is something with a few textboxes or whatever that is able to change those variables in another swf permanently.
Is this possible?
if so, can you point me to something that will help me out?
Thanks!
John iv
View Replies !
View Related
'For' Loop Not Changing ._y Variable
I have the following code:
PHP Code:
on (release) {
cNum = cNum+1;
for (b=1; b<8; b++) {
trace(["box"+b]);
["btn"+b]._y = ["btn"+b]._y+25;
["txt"+b]._y = ["txt"+b]._y+25;
["box"+b]._y = ["box"+b]._y+25;
trace(["box"+b]);
trace(["box"+b]._y);
}
}
on release, the objects labeled btn1, txt1, box1, btn2..... should all be shifting 25pxs. It doesnt do anything. I cant see why.
Does anyone see the problem?
Thanks so much
~ Lacuna aka Seretha
View Replies !
View Related
'For' Loop Not Changing ._y Variable
I have the following code:
PHP Code:
on (release) {
cNum = cNum+1;
for (b=1; b<8; b++) {
trace(["box"+b]);
["btn"+b]._y = ["btn"+b]._y+25;
["txt"+b]._y = ["txt"+b]._y+25;
["box"+b]._y = ["box"+b]._y+25;
trace(["box"+b]);
trace(["box"+b]._y);
}
}
on release, the objects labeled btn1, txt1, box1, btn2..... should all be shifting 25pxs. It doesnt do anything. I cant see why.
Does anyone see the problem?
Thanks so much
~ Lacuna aka Seretha
View Replies !
View Related
Changing A Variable In An Actionscript
Is there a way other than php / xml / text file that i could change a property in an actionscript? basically i have a flash movie that needs to have a slight change in the name (basically a filename) it's referencing from time to time and would like to make it SUPER easy for the person that will update it since they aren't as knowledgable (ha!) as me (double ha!). I wasn't sure if there's a way to embed it in the code without having to have an external file reference or not. below is what i'm using now to embed the object.
<object width="215" height="165"><param name="movie" value="http://www.test.com/test/test.swf"></param><param name="wmode" value="transparent"></param><embed src="http://www.test.com/test/test.swf" type="application/x-shockwave-flash" wmode="transparent" width="215" height="165"></embed>
this is the part of the script i would like to change(really simple and labeled changeme):
http://www.test.com/changme/changeme.flv
Hope this make some sort of sense.
Mike
View Replies !
View Related
Loaded Swf Changing A Variable
Hi
I have some external swf's that I'm loading into my main movie using the movie clip loader class, all working fine.
I have in my main movie the following variable
Code:
var productName:String;
I am wanting this to feed a path for my movie clip loader.
How do I get my loaded in swf to change this variable?
I have tried:-
Code:
arizona_mc.onRelease = function() {
_level0.seeInDetail();
productName = "arizona";
}
This calls the function seeInDetail no problem but it doesn't set the productName var to arizona, what am I doing wrong here?
When I trace(productName) from the name main movie I just get undefined.
Thanks
Ricky55
View Replies !
View Related
Changing Variables Without Knowing The Variable Name - Can It Be Done?
Hi,
I have a set of six variables in _root and I need to alter these as one movieclip is created using duplicateMovie. The problem as I duplicate the movie, I need to change the value of just one of these variables, but a different one each time. I know in SetProperty I can add say "_root. + "somename" to set different properties, but I can't seem to get the same thing working in the set variable command.
So to be more precise my six variables are:
win1_open to win6_open
the six buttons all duplicate the same movieclip but set its internal variable to win1 to win6.
As a user clicks a button it sets vaiable win1_open to win6_open to true depending on which button is clicked.
Each window has a close button in it which is in the original movie. As this is clicked I need it to set _root.win1_open to _root.win6_open to false - and this is the bit I cannot do .
Any ideas??
Thanx
View Replies !
View Related
Changing Variable Names Using Actionscript
Hi,
I have a problem. I need to randomly select a batch of 4 variables from a group of 5 batches. i.e.
batch1 = var1_1, var1_2, var1_3, var1_4
batch2 = var2_1, var2_2, ....etc, etc
Each variable is named similar to those above. I am thinking along the lines of generating a random number between 1 & 5, and then substituting this into the variable name i.e.
var "rnd number" _2
I have used this technique before in Visual Basic and I was wondering if it's possible in Flash5?
In VB the inserted text/variable is encapsulated by &'s. I have tried this in Flash but it don't work.
Has any one got any ideas?
Thanks
Matt
View Replies !
View Related
Changing Variable To Call ASP Rather Than PERL
I had a movie that I 'modified' and the final button script is the following which originally referenced a perl script but Ive changed it to asp.
At the moment it doesnt do anything - it just allows you to submit but no email is received.
Not sure what I am doing wrong.
Here is the actionscript and its meant to call alicia.asp:
on (release) {
name = blastname add ", " add bfirstname;
email = bemail;
i = 1;
z = 1;
while (i <= _root:tags) {
if (eval ("_root:item" add i) ne "<REMOVED>") {
comments = comments add eval ("_root:q" add i) add " " add eval ("_root:item" add i) add " " add eval ("_rootrice" add i)*(eval("_root:q" add i)) add "
";
z = z+1;
}
i = i+1;
}
comments = comments add "
";
comments = comments add "SUB TOTAL: " add totalp add "
";
comments = comments add "TAX: " add tax add "
";
comments = comments add "TOTAL CHARGE: " add charge;
loadVariablesNum (alicia.asp, 0, "POST");
tellTarget (_root) {
gotoAndStop ("ordercomplete");
}
}
View Replies !
View Related
Changing The Variable Assigned To A TextField?
Hey everybody. I was hoping if someone could help me out with this. I have a textfield named "text1" that is assigned a variable. I need to change this variable at a certain point to something else. I'm using MX and I know that they have the command "TextField._variable", which assigns a textbox a certain variable.
What I did, I created a button instance and assigned it the action:
Code:
on (release) {
text1.TextField._variable = "Display";
}
However, this is not changing the variable to "Display". Anybody know what I'm doing wrong? I'm not all that good with actionscript so I prolly might have some simple error.
View Replies !
View Related
Changing Value Of Variable Based On Movieclip
I'm a newbie struggling to figure out how to write this script. I have several variables in a movie that will contain numerical values.
These values will change based on which of several random movieclips is loaded into a target.
Would I put actions in the target mc to determine which random mc is loaded into the target and then set the variables accordingly? Such as:
if the target contains mc1
then set myVariable = 5
else
if the target contains mc2
then set myVariable = 6
end if
I just can't figure out the syntax
Does anyone have an example of something like this I could see?
Thanks
View Replies !
View Related
Changing External Text To Same Variable
I am creating a course which has several lessons. The top frame of the web course is a flash movie that will show the name of the current lesson.
I want to use one flash movie and possibly one text file to swap in the correct lesson name. In other words, I will have a file which looks like this
lesson1 = this is lesson 1&lesson2=this is lesson 2 . . . and so on
What is the most appropriate way to do this?
I know how to use loadVariables to get text into a movie but that's a one-to-one relationship.
View Replies !
View Related
Changing External Text To Same Variable
I am creating a course which has several lessons. The top frame of the web course is a flash movie that will show the name of the current lesson.
I want to use one flash movie and possibly one text file to swap in the correct lesson name. In other words, I will have a file which looks like this
lesson1 = this is lesson 1&lesson2=this is lesson 2 . . . and so on
What is the most appropriate way to do this?
I know how to use loadVariables to get text into a movie but that's a one-to-one relationship.
View Replies !
View Related
|