ActionScript 2.0 :: Making An Imported Variable ( From Php ) Into A Number
Nov 2, 2004
im importing a few variables with this [code]but now how do i make a variable say root.cash into a a number which can be used in equations or used for logical compariosons such as < > ==
View 2 Replies
Similar Posts:
Nov 2, 2004
im importing a few variables with this
Code:
myVars = new LoadVars();
myVars.load("getinfo.php?user1="+userN+"&pass45="+passN+"&random="+refresh1,"0");
[code]......
View 2 Replies
Sep 11, 2005
I have a movie where a variable named daysleft will be loaded from an external text file into a dynamic text box, this bit works fine. But I then need the movieclip "numbers" to gotoAndStop to the frame number imported via the variable daysleft. Although daysleft displays on the screen a trace(daysleft); says the variable is undefined.
View 4 Replies
Aug 12, 2010
it seemed like a simple process but I cant seem to get this right... I got a button there, but the URL wont go, ie, the click does nothing.I imported a PSD layered image to Flash CS3, into a new blank layer. I need basically an area of this PSD to be "image mapped" so what I did was create a rectangle with the rect tool, over the area I needed the hot spot.Here I tried to do a transparent box and border (alpha 0) but the outline is still there even though the box is "empty." I did select the transparent box, no color, and tried alpha, both same result)I made that into a symbol, then I double clicked into there to fill in the key pts for the over, hit, etc., states.... I dont have any effects here btw, as simple as we can get.After that I right clicked on the buttonand entered the action script ("reserve" is the name of my button symbol)
reserve.onRelease=function(){
getURL("http://www.redeggnyc.com/menu2.htm");
}
[code].....
View 2 Replies
Aug 12, 2010
I got a button there, but the URL wont go, ie, the click does nothing.I imported a PSD layered image to Flash CS3, into a new blank layer. I need basically an area of this PSD to be "image mapped" so what I did was create a rectangle with the rect tool, over the area I needed the hot spot.
Here I tried to do a transparent box and border (alpha 0) but the outline is still there even though the box is "empty." I did select the transparent box, no color, and tried alpha, both same result)
I made that into a symbol, then I double clicked into there to fill in the key pts for the over, hit, etc., states.... I dont have any effects here btw, as simple as we can get.After that I right clicked on the buttonand entered the action script ("reserve" is the name of my button symbol)
[Code]...
which gave no errors on validation.When I preview in Flash, everything looks good except the thin black border and the fact that when the button is pressed, nothing happens.
View 4 Replies
Aug 12, 2010
It seemed like a simple process but I cant seem to get this right... I got a button there, but the URL wont go, i.e., the click does nothing. I imported a PSD layered image to Flash CS3, into a new blank layer. I need basically an area of this PSD to be "image mapped" so what I did was create a rectangle with the rect tool, over the area I needed the hot spot. Here I tried to do a transparent box and border (alpha 0) but the outline is still there even though the box is "empty." (I did select the transparent box, no color, and tried alpha, both same result). I made that into a symbol, then I double clicked into there to fill in the key pts for the over, hit, etc., states.... I don't have any effects here btw, as simple as we can get.
After that I right clicked on the button and entered the action script ("reserve" is the name of my button symbol)
reserve.onRelease=function(){getURL("[URL]");}
Which gave no errors on validation. When I preview in Flash, everything looks good except the thin black border and the fact that when the button is pressed, nothing happens.
View 4 Replies
Feb 4, 2012
There are enough examples on the internet to learn how to make your own Class, here's an example of what I did, it is saved as a seperate *.as-File:[code]The Idea is that I can add a bunch of descriptions (for multiple persons) to an holder array, which allows me to do more with them.Actionscript has no idea what this "Character" is. Instead I'm getting the Errorcodes
-1046 (Type was not found or was not a compile-time constant: Character)
-1180 (Call to a possibly undefined method Character)
View 9 Replies
Sep 18, 2005
lets say that when you click on a button the variable number goes up 1 or 2 but it picks it randomly
how would i do it
[Code]...
View 8 Replies
Oct 21, 2004
I want to load an external .swf into my main .swf, it will contain a textfield. However, in order for it to know what to put in that text field, it must pick up on a variable main.swf_global.USERENTRY now in order for my mc user_output to display _global.USERENTRY, what must I do?
View 1 Replies
Oct 21, 2004
I want to load an external .swf into my main .swf, it will contain a textfield. However, in order for it to know what to put in that text field, it must pick up on a variable. main.swf_global.USERENTRY now in order for my mc user_output to display _global.USERENTRY, what must I do?
View 1 Replies
Feb 14, 2010
I am creating a game which uses the sharedObject to save each players progress locally. It also connects to a central database to create an online scoreboard. When a user inserts a score for the first time a unique ID is sent out of the database to the swf and saved as part of the sharedObject data.Absolutely everything works and the ID is saved to the sharedObject, however when the swf is restarted the ID does not load (even though the other variables saved in the sharedObject do load).I think it may be to do with the way it is formatted, perhaps to do with the XML but I'm not sure.
FLASH CODE
function saveGame(currID:Number) {
gameInfo.data["playername"+currID] = playername;
[code].....
View 2 Replies
Feb 20, 2008
i have a project and i need that when a specific variable equals a specific value a random number decreases on the current number, its easy to make it decrease but i need to decrease instead of 4 to decrease a maximun of 5 and minimun of 3.ere is the code :
Code:
numeroDeTazos = 20;
quantidade.text = numeroDeTazos;
if (nrfinal2 == 33)
{
[code]....
View 1 Replies
Oct 28, 2009
I was thinking of making a complex number class but then realized it would be a bit of a pain to have to call functions every time I wanted to perform operations on them. Would there be any way that I could set two complex numbers like so:
Code:
var z:Complex = new Complex(-0.7, 1.4); //where the number is then -0.7 + 1.4i
var c:Complex = new Complex(1, 1.1);
and then store the result in another?
Code:
var x:Complex = z + c;
In other words, is there a way to make the +, -, * and / operators behave in ways other than those they normally would?
View 2 Replies
Mar 29, 2012
I know making a random number divisible by 10 means it isn't so random after all, but stick with me. Imagine a game grid of tiles that are 10x10 pixels. I want to place a 10x10 sprite randomly on the game grid. I've got everything working other than getting my random number function to return random numbers that are divisible by 10. If I give it a range of 10 and 50, I want it to only return 10, 20, 30, 40, 50. You know what I mean. Here's my function:
[Code]...
View 2 Replies
May 2, 2006
I am just making a random number generator and I have got the random numbers going using this script.
Code:
onClipEvent (load) {
go = true;
}[code]....
The only problem is that the numbers are way to fast I'd like them to be 1/2 if not 3/4 the speed that they are. how can I do that?
View 9 Replies
Jan 3, 2004
What is the Math.???? for making a number always have 2 decimal places?
View 5 Replies
Mar 19, 2010
I'm making an interactive kind of game, and I want a number of scenes to change once the user has looked at each once.For example, they go into three different scenes. When they finish looking at them all, Flash records this, and then when they look back at each scene again, they've all changed.
View 10 Replies
Feb 12, 2009
I am working on a client who wants a "Game-like" tour of their facilities on their website. I can use flash and do some very basic actionscript ..especially cutting and pasting
At any rate, I have character that moves on the main tour map and he starts in the parking lot...he can go from one screen ( scene ) to another. But when the character returns to the main tour map he always starts at the same location. As opposed to starting where he just came from. Such as if he just went into the "Process Plant" he should start on the main map at the "Proccessing plant" ... Can I set the X Y coordinates in some type of variable that remembers where he came from when he exits another scene and returns to the main map...?
View 6 Replies
Jan 12, 2010
I've moved to actionscript 3.0 from PHP, and there are some things I just do not get. For example, making a variable name with another variable.Let's say I have movieclips called object1, object2, object3 and so on. I used Math.round() and Math.random() to get a random integer number, and I want to select one of my movieclips according to this number I get.
In php, you can do this:
PHP Code:
<?php
$objectNumber 1;//Let's say this is a random number
[code].....
View 8 Replies
Sep 7, 2010
[Code]...
so what i want it to do is making 10 varibles named Name1 - 10
View 9 Replies
Dec 24, 2002
Making a random variable?
View 9 Replies
Feb 20, 2006
Basically I'm trying to load a variable from an external file and then make that variable available for anything.
Code:
var where;
locSource = new LoadVars ();
locSource.load("source.txt");[code]....
I've tried all the variations of this I can think of. I've defined "where" as a global variable both outside and inside the function, tried to define a separate global value within the function (and changed the syntax of the trace accordingly in either case), nothing works. Basically, the function is being loaded properly; if I put the trace inside the function it shows up perfectly, but the variable isn't available for anything else, which is what I need to happen.
View 4 Replies
Apr 21, 2006
it's possible to have AS take the filename of itself and make it a variable. I need it to be done by AS only. I know it's possible in PHP, but I'm not sure about AS. I'm guessing if it's possible it's one line of code. I'm using Flash 8 but publishing at Flash 6, AS 2.
View 2 Replies
May 3, 2010
var myNumberArray:Array = new Array;
myNumberArray[1] = new Object;
myNumberArray[1].myProperty = 10;
[Code]....
This obviously traces out the string "myNumberArray[1].myProperty", completely disregarding that there's already a variable/property called myNumberArray[1].myProperty, which has a value of its own.
Tracing out this[myStringVariable] just gives an 'undefined'.
Is there any way to get it to trace "10", using only the 'myStringVariable'? In other words, to make AS understand that myStringVariable contains the name of another variable/property?
View 4 Replies
Jan 15, 2011
I'd have thought this to be simple, but nothing works. I have a game I'm working on, and in it, there will be a speed stat. The fast you are going, the faster everything else has to move to make it look like you are moving faster.The problem is, the speed stat (obviously not called speed) is one of the upgradable stats, and needs to be available for the class handling upgrades for it to be changed, and it needs to be read by the class handling moving objects.The second class however, has absolutely no idea the variable even exists. I've tried for weeks to look up a tutorial on it, but there doesn't seem to be any at all that I can find. (I am using public variables, and have tried various ways of trying to point at the class it's from but apparently I must be using the wrong syntax)
View 12 Replies
Dec 13, 2011
I'm making an Elder Scrolls type game and I want my enemies to hurt me after a certain time.So pretend like 5 seconds after they come on the stage they would take 5 hp off me.Then when one of the enemies die it stops until another enemy comes on the stage then it counts how long its been on the stage.This is what I have so far:
Actionscript Code:
var tmr1:Timer=new Timer(2800); var tmr2:Timer=new Timer(5000);
[code]...
View 1 Replies
Feb 13, 2012
AS3 says you need to load variables into a class?my variables look like this... (the whole point of playing around with variables was that if I had to make a change I could access one place and change them but now I realse that I can't access or call them outside the movie clip they are in.[code] The Wholesale price. A wholesaler is usually a big shed where goods are stored.
View 7 Replies
Aug 19, 2009
I've got an animation that plays, and then at the end of the timeline plays a movieclip. This movieclip displays a piece of text, which is extracted from an XML file, the piece of text is selected at random currently out of a list.
Then when the clip is pressed (button), it goes back to the previous timeline, and then plays through again, including the movieclip, and now a new piece of text is picked at random and displayed.I now want to make the pieces of text display sequentially, but am having some trouble.
put in a counter, and the text that is displayed from the array corresponds with the number on the counter, unfortunately, this gets wiped every time it plays, because the counter gets remade. Is there any way to create a variable outside of the timeline maybe, in a actionscript file maybe, so that I can just add to this. I have been running a trace, and can't seem to get it to not wipe.
View 3 Replies
Sep 7, 2011
I have a problem where I make a variable in one class and change it using the constructor method in another.Is there anyway that I can make that variable available in all methods in this class? Here is the code:
[Code]...
View 3 Replies
Jul 31, 2002
The situation is like this:I have Five buttons named button1 to Button5.What I want is to make one button invisible.To to this I have a for 1 to 5 -loop and I want to make one button invisible if it meets certain criteria.Is this possible without make an if-line for each button or not??
View 4 Replies