ActionScript 2.0 :: Making A Variable With X And Y Position?

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


Similar Posts:


ActionScript 3.0 :: Making A Liquid Layout - Define The X Position

Dec 10, 2009

I am pretty new with AS3 . I am making a liquid layout in flash using as3, it worked pretty well with the following code, for the movie clips that are going to be on stage from the very beginning.

[Code]....

as you can see I have defined the variables Width adn Height inside the function as well and I am using WIDTH/2 to define the x position, Well it laods in the exact position but won't float as I minimize the stage

View 2 Replies

ActionScript 3.0 :: Making A Slide Bar Stay In Position After A Reload

Jul 21, 2010

I am making a widget in AS3, looks like a equalizer.

I'm having the problem when swf reloads, everything will reset. Is there a way to keep this from happening. I was thinking maybe XML.

I am thinking as the user scrubs it is writing the XY coordinate to the xml doc but i dont think that can work because the xml doc would then haft to be saved.

Any thoughts on what key words I need to search for in the net.

View 5 Replies

ActionScript 3.0 :: Making A Code That Automatically Writes The Mouse's Current X And Y Position As Text?

Jul 6, 2009

I have trouble making a code that automatically writes the mouse's current x and y position as text every frame.

View 3 Replies

ActionScript 2.0 :: Variable For X, Y Position?

Nov 20, 2009

I have bought some code to make a starry night in my animation but I need to make this either only appear inside a movie clip, or on a certain part of the stage, can anyone tell me how to alter the below code so I can do this? do you I need to add in some x, y coordinates?

import mx.transitions.Tween;
import mx.transitions.easing.*;
var maxStars:Number = 25;
var minSize:Number = 50;

[code]....

View 1 Replies

ActionScript 3.0 :: Making A Variable Name With A String?

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

ActionScript 3.0 :: Variable Making Loop

Sep 7, 2010

[Code]...

so what i want it to do is making 10 varibles named Name1 - 10

View 9 Replies

ActionScript 2.0 :: [FMX] Making A Random Variable?

Dec 24, 2002

Making a random variable?

View 9 Replies

ActionScript 2.0 :: Making A Variable Available Outside A Function?

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

ActionScript 2.0 :: Making Filename A Variable

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

ActionScript 3.0 :: Making A String Contain The Name Of Another Variable?

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

ActionScript 3.0 :: Making One Variable Available To Multiple Classes?

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

Making Something Happen After A Variable Has Been On The Stage For A Certain Time?

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

Professional :: Making And Loading Variable Classes

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

ActionScript 3.0 :: Making A Universal Variable As A Counter?

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

ActionScript 3.0 :: Making A Local Variable Global?

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

ActionScript 2.0 :: Making A For-loop With Button Variable?

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

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

ActionScript 2.0 :: Making A Imported Variable ( From Php ) Into A Number?

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

ActionScript 1/2 :: Variable To Track Position In Timeline

Sep 10, 2009

I am trying to create a variable in Actionscript 2 that will record the position in the timeline, so Flash knows the user's last position on the timeline.The first line in the mc is: var portfoliostate;On frame 20 of the timeline, I have the following actionscript: portfoliostate = "1_ portfolio";When a button is clicked, I want Flash to recognise if the user has been on frame 20 or not. The code on the button is:this.onRelease = function()[code]However it does not seem to be working. I am implementing this correctly?

View 3 Replies

Professional :: MoveMC - Adding Variable To Y Position

Mar 31, 2010

I have the following working line:
moveMC.y = twn.bounceBall01.y
It successfully gets the y value of bounceBall within the MC twn, and applies it to the y value of moveMC. How do I replace the 01 in bounceBall with the following global variable: globals.data.clk? I've tried using a way that Ned successfully showed me for a different situation, plus tried some other permutations, but Flash says "no way dude".

View 1 Replies

Professional :: Netstream FLV Position Store In Variable?

May 16, 2010

I have a AS2 netstream instance, in which I am loading various flv's into. The 'main' video has links to other visble when its playing. I want to be able to store the position of the flv (in seconds) so that when the user comes back to the 'main' video it remembers where it was and contiues to play. This is the code I have written so far regarding this (its probably massively wrong).

var remember:Number;
if(ns.play == ("flvs/reel.flv")) {   ns.time = remember;  trace ("stored"); }

[code]....

View 1 Replies

Flash :: Get The Position Of Instance Whose Name Is Stored In An Variable?

Nov 18, 2009

How can I obtain the position of a instance whose name is stored in an variable? If there is a instance whose name I don't know, but the instance's name is store in an variable x. How can I obtain its position?

View 4 Replies

ActionScript 2.0 :: Position Dynamic Text Box With A Variable?

Mar 8, 2011

I would like to load my text variable(numerical value)into the _y = ???;Here is how I'm loading my text file. Variable1 works. Variable2 doesn't(script was a guess)

as
myData = new LoadVars();
myData.onLoad = function() {

[code].....

View 6 Replies

ActionScript 2.0 :: Making Button Invisible Using Its Instance In Variable

May 1, 2006

I am just trying to make a button disappear using a variable set to it's instance name. When I say invisible I also mean deactivated. The code I've got is this..
Code:
[test]_visible = false;
but it doesn't work - any offers?

View 5 Replies

IDE :: Making A Global String Variable Visible To MovieClips?

Jun 4, 2009

I mostly use flash for the animation, so my action script tends to be mostly functional.

I am now however having an issue, i am using a variable called language which I am setting in frame one as "dutch", "english" , "german" etc... Im then using this to set dynamic text as appropriate in each frame as necessary.(and yes i may switch this to case statements )

if (language == "dutch")
{ tcMC.peasantBubble1.peasantSpeech.text= "Bescherm je een schat?"};

My problem is however that one Movieclip does not see the language variable.

Is there anway in CS4 i can direct it to where it is, or define the varibale instead to be global (perhaps id have to change it from a string though)?

View 2 Replies

ActionScript 3.0 :: Code Doesn't Define Position Variable?

Nov 28, 2010

I run a demo code,it extends Sprite,like follows:

public class Vehicle extends Sprite{   protected var _position:Vector2D;   public function Vehicle(){     _position = new Vector2D();    draw();   }   protected function draw():void{     graphics.clear();     graphics.lineStyle(0); [code]....
 
I don't understand following code,because I only define _position and don't define position variable,why I can use position.x?     x = position.x;     y = position.y;

View 1 Replies

ActionScript 2.0 :: Math Function - Set Variable To Random Position

Sep 2, 2011

I cant get this to work. I think its pretty self explanatory what I want to do, set _x to a random position (b1 - b6)

Code:
onClipEvent (load) {
stop();
b1 = 462;
b2 = -462;
b3 = -1388;
b4 = -2314;
b5 = -3240;
b6 = -4166;
} onClipEvent (load) {
RanNum = Math.ceil(Math.random() * 6);
_x = ["b" + RanNum];
}

View 2 Replies

ActionScript 2.0 :: Multiple Classes Accessing The Same Variable Without Making It Public?

Dec 26, 2006

i've got two classes and i'm not extending to MovieClip. I like to attach the mc in the constructor just because i'll be working with different MC's that have the same purpose.

however, im using private var loadedMC:Movieclip and now i've got another class that needs to be able to access the instance's variable.

for example, myClass.loadedMC , but this would mean having to make it public and I rather not go that route.

View 2 Replies

ActionScript 2.0 :: Change The Position Of One Of The Boxes With The Number Of The Box As A Stored Variable?

Jul 12, 2010

I have flash create an empty movieclip, screen_1, then attach 4 different colored movieclips to the empty one: box_1, box_2, box_3, box_4.Now I am trying to change the position of one of the boxes with the number of the box as a stored variable. So say:

boxNum = 1

this["screen_1.box_" + boxNum]._x = this["screen_1.box_" + boxNum]._x +1600

I can get this to work on the main movie clip.. but not on the movieclips inside of it.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved