ActionScript 2.0 :: Edit A Variable In _root From A Function?

Apr 8, 2010

I want to edit a variable in _root from a function

it should look like this:

Code:
var index:number = 0;
function fnct (root_counter){

[Code]....

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Change The _root.broj And _root.logo Variables Inside The Function?

Jan 14, 2010

In the code below i want to change the _root.broj and _root.logo variables inside the function which returns values from .php file. Inside the function everything works fine and all values are correct but when i trace var broj outside the function it's still 0.

var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();
var broj:Number=0;
var logo = new Array();

[Code].....

View 1 Replies

ActionScript 2.0 :: Add The BlockOneUp Variable To The _root.Block?

Jun 15, 2008

I need some help with some variable problems. (AS2)

Code:
if (_root.Block+blockUpOne.dead == false) {
surroundingBlocks++;
}
I'm targeting a duplicated mc from another duplicated mc. The 'blockUpOne' is the variable of the number on the end of the duplicated mc (the "i" variable when the mc was created 20, the amount of blocks in the grid across). Basically I'm trying to target a block on top of the one with the code on. I need to add the blockOneUp variable to the _root.Block to made a string which targets a duplicated mc above the one with the code. Even more basically, I want to target an mc by adding a variable to the targeting code.

Example:
Block above: Block34
Block with code: Block54
if(_root.Block+(54-20) is alive){
do stuff
}

View 9 Replies

ActionScript 2.0 :: Calling A Function In A MC From _root?

Mar 25, 2006

I was wondering, is it possible to call a function in a MC from the _root of the movie?

I have an MC called timer, linked aswith a function in it,

Code:
testFunc = function(){
trace("It Worked!");
}

On the _root in the first frame I have this,

Code:
_root.attachMovie("timer","t",5);
_root.t.testFunc();

View 10 Replies

ActionScript 3.0 :: ReferenceError: Error #1065: Variable _root Is Not Defined

Jul 15, 2009

I was following a tutorial and input the AS code :

_root.onEnterFrame = function(){
if(_root._xmouse<50){
imgBar.prevFrame();
}
}

and im getting this : ReferenceError: Error #1065: Variable _root is not defined.
at Sliding_fla::MainTimeline/Sliding_fla::frame1()

View 7 Replies

ActionScript 2.0 :: Stopping A _root.onMouseDown = Function()?

Oct 7, 2003

i have a:

Code:
_root.onMouseDown = function(){
someAction

[code].....

View 4 Replies

ActionScript 2.0 :: Put The Character Variable And Info In The First Keyframe And Refer To These Via _root In Any Frame

Dec 29, 2010

I am trying to make a game to learn actionscript. my game is going to have multiple keyframes, ie one for dungeon, 1 for a large map yadda yadda yadda. Things like the character i would like to be available to all keyframes. i am assuming i put the character variable and info in the first keyframe and refer to these via _root in any frame. However if i want to make a dungeon and use the dungeon scene variables i would use this.

right now since i am only on the making a dungeon part i can refer to anything using this or _root. Case: my dungeon scene consists of walls and paths. right now i can do something like if(_root["path" + yPos + xPos]) _root["path" + yPos + xPos].removeMovieClip;

i can also call the same code using this instead of _root and it works. when i add a main new main frame and move the dungeon scene from frame 1 to frame 10, will i still be able to inter use _root and this and have the same effect, or once i move the dungeon scene from frame 1 to frame 10 i will no longer be able to use _root. also i only have 1 layer.

View 3 Replies

ActionScript 2.0 :: _root.cargo Are Multipled By 10 And Added To _root.totalscore?

Feb 27, 2003

im lookin to make this so that the points taken from the _root.cargo are multipled by 10 and added to _root.totalscore

[Code]...

View 2 Replies

ActionScript 2.0 :: _root._root[eelmine].nextFrame()?

Sep 14, 2004

if a condition is true, then:_root.(MC with instance name that is the value of "_root.eelmine").nextFrame(); is this correct?_root._root[eelmine].nextFrame();

View 16 Replies

Actionscript 3 :: Flash Cs5: Set A Variable Using A Function, Then Read That Variable From A Different Function

Jan 29, 2012

I have a public variable and I am trying to set it, then read it from a different function:

public var str:String;
public function DailyVerse()
{
function create() {

[Code]....

My trace results says null. Why does it not give me "hello"?

View 1 Replies

ActionScript 3.0 :: Have Multiple Buttons And Edit Them All In A Single Function

Sep 18, 2007

I have a single movieclip named button, and I want to use a "for" to multiply that movieclip, that way I can have multiple buttons and edit them all in a single function.

It would be something like this:

var _button = new button;
for(i=0; i<5;i++){
_button[i]:button = new button;
addChild(button[i]);
}

View 4 Replies

ActionScript 3.0 :: No Longer Move The "_root" By Changing The _x And _y Positions Of The _root?

Jan 26, 2009

I just recently began migrating from AS2 to AS3, and I have of course realized that I can no longer move the "_root" by changing the _x and _y positions of the _root (which no longer exists in AS3). How can I do this in AS3 (specifying _x, _y, _z possibly of the "_root")?

View 2 Replies

ActionScript 2.0 :: Basic Preloader - Dynamic Text Box Which Should Read The Variable "_root.loadText"

Jun 22, 2010

I admit I'm fairly new to flash, but I've almost finished an entire RPG battle system complete with music [etc. etc.] - but my problem is trying to add a preloader.. I have a basic page which says "Loading" and has a Dynamic text box below which should read the Variable "_root.loadText". In the first frame I have this code:

[Code]...

and in the second just "_root.gotoAndPlay(1);" for the updating process. I'm sure that's all okay. But when I export it, then upload the swf file to somewhere like SwfCabin to show people for testing purposes, they have to wait on just a blank white screen for 1~3 minutes.. -note: I use both Adobe flash CS3 [at home] and Macromedia Flash 8 [at school] - I can stick to just CS3 if needed.

View 2 Replies

ActionScript 3.0 :: Call The Global Variable Using "_root."

Feb 7, 2011

In actionscript 2.0, I can call the global variable using "_root."

ActionScript Code:
var str1="global"
function a(){

[Code].....

But it seems that I cannot do the same in actionscript 3.0 by using "root."

View 4 Replies

ActionScript 2.0 :: Use "_root" When Declaring A Variable?

Feb 10, 2010

i want to access variables from within movie clips, and my question is, when declaring variables from the root, is it necessary to add the _root? e.g.:

Code: var _root.imgSource:String = "img001.jpg"; or would it be sufficient to declare the variable in the root timeline, then refer to it in child clips as _root.imgSource?

View 7 Replies

ActionScript 2.0 :: Set "_root" Of A Swf To A Local Variable?

Mar 16, 2008

I'm cheating and using lockroot function atm

but how do I set "_root" of a swf to a local variable?

localroot = this ?

View 1 Replies

Actionscript :: Edit Some Flash To Make An External Javascript Function Call

May 3, 2009

I'm trying to edit some flash to make an external javascript function call, but with no success. Here's my actionscript 2.0 code:

[Code]....

I've seen lots of examples and I'm mainly confused about the use of ExternalInterface.addCallback. I don't need the javascript to return anything to flash, so is this necessary? For whatever reason, I never see the alert. Does anyone see any problems in my code? Is there some ExternalInterface library I don't have? Also, what's the BEST way to use ExternalInterface (ie; error checking, etc.)

View 2 Replies

ActionScript 3.0 :: Edit The Content Without Having To Edit The FLA File Or Any Code?

Aug 11, 2009

I'm actually relatively new to flash and actionscript but I could say I have fair knowledge about them. So anyway, I usually build flash websites the traditional way using timeline animation and scripting. Today I had a job interview and they said they're looking for someone who can develop any web design into a Flash CMS with a back-end office for the client to edit the content without having to edit the FLA file or any code.

Accordingly, I'd like to know where and how to start. What are the main concepts I should follow/adapt?

View 1 Replies

Actionscript 2 :: Function's Local Variable Through A Concatenated Variable String?

Mar 7, 2012

how you would target a function's local variable through a concatenated variable string.For example:

var txt = "Hello World";
function testing(msg) {
var test1 = msg;[code].........

I'd expect the trace to be "Hello World" but rather is given "undefined". So if variables created outside functions are created on the main timeline, where are local function variables created and how would you access them?

View 2 Replies

ActionScript 2.0 :: Variable In LoadMovie Function - Load A Variable That Contains An Url To An Image

Jul 28, 2007

I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this: [URL] Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in.

View 2 Replies

ActionScript 3.0 :: Monitoring Variable - Call A Function Whenever The Variable Value Changes

Nov 24, 2010

I want to monitor a variable. Whenever the variable value changes I want to call a function. In actionscript 2 I can use "watch" but in as3 what can do ?

View 1 Replies

ActionScript 3.0 :: Declaring A Variable In A Function: Either The Function Or The EventListener - Doesn't Work

Nov 27, 2009

I have a set of Cue Points in an FLV I'm playing. It's an interactive quiz, so the idea is that flash will change a variable, theAnswer, to a different letter depending on which question it is. The answer to question 1 is B, question 2 is D, etc. Either the cue point event listener isn't working, or else it is working and Flash isn't declaring the variables. 1120: Access of undefined property theAnswer. I literally can't find a single problem with my code. I have an almost identical Event Listener further down which works.

[Code]...

View 4 Replies

ActionScript 3.0 :: Function Returning Array And Declaring A Function With Event And Variable?

Jul 27, 2009

is it possible to declare function this way

ActionScript Code:
function startShake(e:MouseEvent, num1, num2):void

what i mean is it possible to send to the function not only en event but also a variable and a second question how can i access

ActionScript Code:
function stopShake(e:MouseEvent):Array

this array that function return.

View 1 Replies

ActionScript 2.0 :: Passing Variable To Function Inside Function?

Sep 16, 2009

I need to pass a variable to a function inside a function. However this parameter (i) seems not to be passed (to function ...onRollOver). This is required to attach a textfield to a movieclip (reading the adress and showing it as a tooltip).

ActionScript Code:
for (i=0; i<array_BE_ElecCities.length; i++) {
var attachElecCity = mc_map.mc_places.attachMovie("Plant",

[code].....

View 1 Replies

ActionScript 3.0 :: Declaring A Variable Inside A Function To Use Outside The Function?

May 5, 2011

I want to create a vector, then call a function that populates that vector with arrays. Fine. The only catch is the function itself will declare new array variables to put into the vector, but are these new array variables private to the function only?e.g. something like this

ActionScript Code:
public var vec:Vector.<Array> = new Vector.<Array>();
private function populateVec():void {

[code]....

Is this "kosher"? a was declared in the private function but added to something outside the function..?

View 4 Replies

ActionScript 2.0 :: Function For _root - Control A Movie Clips Current Frame By Another Movie Clips?

Sep 13, 2009

I'd like to control a movie clips current frame by another movie clips action script.I realise the following controls the outside (root) frame time line:

on(release){
_root.gotoAndStop(1);
}

but I'm not sure how to apply that to my other movie clip. I'm guessing it would be something like this:

on(release){
_*movie_clip_name*.gotoAndStop(1);
}

View 1 Replies

Actionscript 3 :: Call Value Of Variable Which Is In One Function To Another Function?

Feb 18, 2010

I have taken variable in one function and want to use that value in another function.

View 2 Replies

ActionScript 3.0 :: Flash : Getting Variable Value From A Function To Outside The Function?

Jan 23, 2012

how to get variable value from a function to a text box here is the code :

import fl.controls.ComboBox;
import flash.events.Event;
import flash.events.MouseEvent;
TxtAnswer = Array();

[code]....

.. i want that variable "sk1" to next scene text box ..i putted the code like this :

q1.text = sk1;

but it is not working..

View 4 Replies

Actionscript 3 :: Function Use Variable From Another Function?

Jun 24, 2011

me how I can use the variable from one function in another function?

For example:

function init():void {
var test:Number = 1;
}

[Code].....

View 1 Replies

ActionScript 1/2 :: Can't Get Function To Use Variable!

Feb 1, 2010

I have created an actionscript function which stops an animation on a specific frame which works fine. I have then loaded in a php file with a variable which will contain the number for the frame i want the animation to stop on. This has loaded in fine and i have loaded it in a function. what i cant seem to do is to get the variable into the function which tells the animation to stop playing.
 
here is my code: 
 
//load variablesvarReceiver = new LoadVars(); // create an object to store the variablesvarReceiver.load("http://playground.nsdesign6.net/percentage/external.php");//load variables

[code]....

View 1 Replies







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