AS2 :: IDE : Dynamically Referencing ROOT?

Aug 3, 2009

I am having trouble dynamically changing the reference to root in my movies. Here's what I'm trying to do: I have a main movie(_level0.mainMovie) that I am loading external .swfs into. However, I want to be able to test the child movie clips without having to load them into the mainMovie(for testing purposes). In such a case, the child clip would be at _level0 or _root. I would like to add some code to the child clips to test whether they are the _level0 clip, if not, then I want to change their reference to _root. Here's what I've come up with, which doesn't seem to work:

Code:
function testLevel(){
//This code goes into each child clip to see if it has been loaded into another clip
trace(this);
if(this == _level0){ //If this is the _level0 clip

[code]....

View 4 Replies


Similar Posts:


Referencing Varible In Root From MC?

Mar 28, 2009

I have a varible in my root

Code:
place = "1";
i want to refence it in one of my MCs so that i can run a statement like this:

[code]....

View 2 Replies

Actionscript 3.0 :: Referencing .root In Embedded Swf

Jul 27, 2009

dynamically loaded swf files that employ .root syntax. I'm loading in several older swf files into a master swf. The master has a previewer that lets the user preview the library of swf files. Some of these older swf files have buttons in them that use .root, and I don't want the .root to effect the master swf, but the loaded one.

View 5 Replies

ActionScript 2.0 :: Referencing Root Timeline From Within A Mc

Aug 20, 2006

I have a root timeline in which contains a movie clip on a certain frame. Inside that movieclip, on it's second frame, there is a button. I would like to use this button, when clicked, to move take the user to a frame on the root timeline.

View 5 Replies

ActionScript 3.0 :: Referencing Movieclips To The Stage Or Root

Jun 18, 2009

I have a movieclip "submenu" that is on the main timeline, and inside this movieclip, I have some ActionScript:

[Code]....

View 3 Replies

ActionScript 2.0 :: Referencing Functions In Root Timeline

Jun 30, 2009

I have a 13 movieclips within another movieclip which in turn is placed on the root timeline. I have written a function in the actions layer of the main timeline:
function illboxClear(){
_root.illpre.ill1.gotoAndStop(1);
_root.illpre.ill2.gotoAndStop(1);
_root.illpre.ill3.gotoAndStop(1);
_root.illpre.ill4.gotoAndStop(1);
[Code] .....

It sends the animation in each of those described movieclips back to frame one as you can see. When I try to call the function from actions on a button which itself within a separate movieclip placed on the stage:
on (rollOver) {
illboxClear();
_root.illpre.ill2.play()
} on (rollOut) {
_root.illpre.ill2.play()
} on (release) {getURL("boxer.html","_blank");
}
It doesn't work! Can I not call functions from button objects or have I made some other elementary error?

View 7 Replies

ActionScript 3 :: Inaccessible Error When Referencing Document Root Object

Apr 22, 2011

I'm trying to reference the document object from various classes in my class library. Everything seemed to be going peachy until I started getting this random, weird error. I thought maybe it was Flash acting up all of a sudden but I tried it on my Mac as well and I get the same error. Basically no matter WHAT I do, I am getting the error:
1195: Attempted access of inaccessible method getSessionHandler through a reference with static type pim:PClient

It's a lot of code, but here is the full code.
// PClient.as
package pim {
import flash.display.MovieClip;
import pim.gui.PGConsole;
import pim.loader.PCommandLoader;
[Code] .....

Alright so right now, I have sort of a singleton reference that I'm using so I can reference the document object from any class (without the need to pass the client object to each class that needs to use it). I'm pretty sure I've done this before and had it work, but obviously it is not. I've even tried passing the client object (this) to the PCommandLoader object and it still gives this really strange error (that is without the use of any static methods, etc.).

I've tried everything -- even a class that holds the PClient object reference, which was really messy -- and it still gives this really, really weird message. Even referencing the root property on movieclips gives me this error. The movie was working great and then magically it started doing this. I backed everything up and undid everything back to pretty much empty script files and it wouldn't let me compile since...

View 2 Replies

ActionScript 3.0 :: Referencing The Root Frame Label In A Switch Test Expression?

Sep 30, 2009

How do I reference the root frame label in a function for event dispatching using a switch statement.

SUMMARY: This is simple, but as I've stepped away from ActionScript for too long, I'm having trouble figuring out the proper test expression to reference the root timeline frame label (e.g., switch(the root frame label)).

Nothing i've tried works:
switch(this.label)://obviously this would look at the button timeline switch(event.root.label)://player says there is no "root" property ...

STRUCTURE: I have five MCs, one on each of five frames. I have a forward button and a back button. I created a switch statement to specify different actions, based on the root frame label. Frame labels are f1, f2, f3, f4, fend.

THE RELEVANT CODE on Frame one ("f1"):

Code:
stop();
nexter.addEventListener(MouseEvent.CLICK, onNexter);
nexter.buttonMode = true;

[Code]...

View 3 Replies

ActionScript 3.0 :: Dynamically Referencing Movieclips?

Nov 28, 2011

I'd like to know how I can achieve this in AS3. The code would work fine in AS2, but as I am very new to AS3 I am not sure what the equivalent would be in AS3.

code:
humanNum = 1;
MC = ["Human"+humanNum];

[code].....

View 1 Replies

IDE :: Referencing A Dynamically Created Clip?

Jan 10, 2010

here is a snippet of code in first frame of the movie I have trouble with:

----------------
for (var i = 0; i < 5; i++) {
var container:MovieClip = new MovieClip();
this.addChild(container);

[Code]....

I am getting an error message: A term is undefined and has no properties. I checked list of objects and container0.one and it's there but I can not get to container0.one.usecase

View 6 Replies

ActionScript 3.0 :: Dynamically Referencing Movieclips On The Stage?

Jan 20, 2011

Just wondering, is there any way to dynamically reference movieclips on the stage, as in through a for loop like so:

for (var i = 0; i < 10; i++) {
["mc" + i].x = 10;
}

[code]........

View 3 Replies

ActionScript 2.0 :: Referencing Dynamically Created Variables?

Dec 9, 2006

I have a number of 'TweenField' instances created in a for loop. The problem is that each time the loop increments, the 'myTweenField' variable has the same name, so I don't know how they can be referenced individually from elsewhere in the script. How can I rewrite it so that each instance has a unique name, and how would I then reference it from outside the loop?

Code:
package
{

[code].....

View 11 Replies

ActionScript 2.0 :: Referencing A Field In A Dynamically Created Movie?

Jul 17, 2010

I'm using Flash 8.

I've made 18 movies in a for loop. I'm trying to modify a text field in those movies. I am unable to do so in the for loop. Something with my referencing is wrong.

The dynamic text field in each movie is named "eventText".

ActionScript Code:
_root.attachMovie(myData["loadHandler"+x]+"Movie", myData["event"+x], x, {_x:100, _y:100});
_root.myData["event"+x].eventText.text = "test";

If I hardcode the event name for testing purposes, it puts the data in correctly:

ActionScript Code:
_root.houseSale2.eventText.text = "test";

View 4 Replies

ActionScript 3.0 :: Referencing Library Items Semi-dynamically?

Aug 16, 2010

I'd like to add a couple of different MC's to the particle stream. I'd like to do that by referencing different items in the library.So I have 12 different particles in the library exported with classes named from Bubble0 to Bubble10 now as I run through my for loop I'd like it to use a different particle each time. first time I tried:

ActionScript Code:
var bubbleArray:Array = new Array();
bubbleArray.push(Bubble0,Bubble1,Bubble2,Bubble3,Bubble4,Bubble5,Bubble6,Bubble7,Bubble8,Bubble9,Bubble10,Bubble11)
for (var j:uint = 0; j < NUMBER_OF_BUBBLES; j++) {

[code]...

Scene 1, Layer 'actions', Frame 1, Line 871086: Syntax error: expecting semicolon before leftbracket.Is what I'm trying to do possible without some clunky switch statement?

P.S. I tried searching the forum for an answer but the terms are so common I couldn't find what I'm looking for.

View 6 Replies

ActionScript 3.0 :: Dynamically Referencing Objects Names In Loop

Jul 12, 2009

The problem is referencing object names dynamically in AS3, in a loop. Example. I have an array called c4 which i would like to reference like this:

I have a number
var x:Number = 4

How can I do something like
trace(["c"+x].length);
(I know this is wrong!)

Same with other objects
E.g. Movieclip called mc4
["mc"+x].x = 100;

View 3 Replies

ActionScript 2.0 :: Referencing/loading A Dynamically Created Movieclip Variable?

May 23, 2008

I am trying to load an image in to a dynamically created movieclip, which is:

_root.mySlider."+stripX2(band[i][0])+i

but I can't seem to reference it. I can load the movie into _root.mySlider, but if I add the dynamic element (stripX2(band[i][0])+i) without quotes it it doesn't load. If I load with quotes i.e.

"_root.mySlider."+stripX2(band[i][0])+i

flash doesn't allow strings in movieClip variables.The code I'm using is belowm, it's the second to last line thats causing the problem:

var loadListener:Object = new Object();
loadListener.onLoadComplete = function(target_mc:MovieClip):Void {
trace(">> target_mc._width: "+target_mc._width);[code]......

View 2 Replies

ActionScript 3.0 :: Root.stage In Dynamically Created MovieClips

Oct 28, 2009

currently working on my first AS 3 project. The transition from AS 2 to AS 3 has been tough but rewarding. However, still fiddling with dynamically created objects though (using a database for my site-content). Here's my problem: If I dynamically create a MovieClip I can no longer access the main stage. Since I'm using a mousedrag interaction I need a global MouseUp Listener. If I try to access 'stage' or 'root' or 'parent' from within the dynamically created MovieClip the result is always 'null' instead of what's really there. Is there an easy way to access the main stage from within the created object?

View 3 Replies

Call A Function In Root From A Nested - Dynamically Loaded Movieclip?

May 13, 2011

Does anyone know the best method to trigger a function in the root from a dynamically loaded movieclip (loaded using addchild) using AS3, I understand targeting root is not the best way to do this?

View 2 Replies

ActionScript 3.0 :: Crossdomain Policy File On Root Level Cannot Be Deployed On Root Level? 

Jan 14, 2009

Situation:

- We have a Flash application located on a SAP EP (let's say ep.x.com)

- We have a SAP ABAP Application (Webservices) on a SAP WebAS
server (abap.x.com)

- Clarification: This is not about Flash islands / but a normal Flash application communicating with WebAS ABAP via WebServices

Problem: Due to the changed security policy in Flash 10 this scenario does no longer work.

- A crossdomain policy file on root level cannot be deployed on root level

- The WebServices http/s headers cannot be modified, since the WebServices are generated by the WebAS IDE.

Comment: Technically there is a way to patch a WebAS ABAP,but this is not a practical / acceptable way in a normal SAP WebAS infrastructure.

Conclusion:- The above scenario (Flash from EP content / WebAS ABAP as backend) is a quite normal scenario in the SAP world.

- SAP / Adobe always features the close relationship between their technologies.

Question:- What could we do?

- How does the Visual Composer works around that problem?

View 1 Replies

Actionscript 3 :: Position Loaded Object Based On Root Stage Instead Of MC That Is Loaded From Root

Mar 22, 2010

I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.How can I called the root stage properties rather than adding MC2 into the stage?

View 1 Replies

Flash - Tell The Root Timeline To Root.gotoAndStop(2); From The Timeline Of A MovieClip Added Using AddChild?

Nov 7, 2011

How do you tell the root timeline to root.gotoAndStop(2); from the timeline of a movieClip added using addChild?In the maintime line I have

addChild(fade_eng);

and in fade_eng I have the following on frame 20

root.gotoAndStop(2);
this.gotoAndStop(1);

But I am getting 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.

View 1 Replies

ActionScript 1/2 :: Outside Image Referencing?

Oct 24, 2009

basically i was trying to make a program execute on the web, but it needs to load in pictures and since i didnt want to make the file size massive i converted where the images would show into a movie clip and used the loadMovie(pathname) procedure (im using AS2) to link the files, it works obviously when i test run it. in the pathname section i have "images/pic1.jpg" and so on for the different pictures as a tutorial i followed lead me to believe that it would find the pathname the program is running from and add the suffix images/pic.... etc to find the picture.

the problem is when i run it on the web its still trying to find the files on my computer, even though there is no part of the code that tells it to look in my documents/folders etc. even when i tried to link the file exactly, so put in oadMovieMy question is why is it still trying to find my local document folders instead of looking at its own run source on the internet. is there a way of absolutely linking it to the images i have now on the internet instead?

View 4 Replies

Xml :: Read A Value Of A Tag By Referencing Their Position?

Feb 14, 2011

I'm trying to read an XML file with actionscript 2.0

The problem is I can only make my code to read a value of a tag by referencing their position.

e.g.
var currentIcon = myXML.firstChild.firstChild.childNodes[0].firstChild;

How do I retrieve a value from an XMl file by referencing their tag name?

e.g.
var currentIcon = myXML.firstChild.firstChild.childNodes['icon'].firstChild;

Here is my XML file...

<weather>
<current>
<icon>Partly cloudy</icon>

[Code]....

View 1 Replies

Actionscript 3 :: Referencing The .js File

Sep 25, 2011

I have a process set up to create action script files. They hold functions that are called upon by my flash project. How can i reference these files so that the project knows the functions are there. with asp.net i would simply reference the .js file. Is it the same process?

View 1 Replies

ActionScript 2.0 :: Referencing To Mc Names?

Sep 29, 2010

I've got another problem (similar to my last), although this time it's movie clip names, rather than variables.[code]I've created some movieclips as such ^ so for each user there are 2 empty movie clips, and now I'm trying to reference to these movie clips, but am having some trouble in doing that, for example:[code]While the last one doesn't bring any errors, it still doesn't seem to work.[code]

View 9 Replies

ActionScript 3.0 :: Referencing Another Object?

Nov 12, 2010

How do you reference and already existing object in as3? My below program draws 2 circles and a line to connect the two. The circles and the line are all individual objects. The line (connector class) has a function called update that should redraw the line between the two circles. It has two variables which I want to be the references to the two circles. The circles (coolcircle class) has a variable which I want to be the reference to the connector. It doesn't seem like my update() function is getting called.

ActionScript Code:
package
{

[code]......

View 3 Replies

ActionScript 3.0 :: Referencing A Primitive

May 26, 2011

I wish to pass a reference to _camera.y, but _camera.y is a primitive and gets passed as a value.Here's the code for a little debugging class.

ActionScript Code:
package
{
import flash.events.Event;[code]..........

If I call watch("Cam Y", _camera.y) I get "0" traced out all the time - I assume because the y position of the camera is being passed in as a value.I want to pass it in as a reference so that this little class will keep an eye on the y position of the camera.

View 2 Replies

ActionScript 2.0 :: Referencing One Element From Another?

Jul 13, 2011

I made the mistake of purchasing one of those flash template sites. I have most of it customized, however I need to flip between gallery images when the user selects the menu item. how to reference one element from another... I need the release event of the menu item (which i already have stubbed out, to trigger a tweenMenu function call... however, I don't know how to get the path of the argument to pass the object to the tweenMenu function call.

I need to make this call (in theory)

tweenMenu2(_root.gall, _root.xkoord[(_root.small-1)] );

however, the path to gall is:

_level0.instance146.gall

how i would make the above call using the correct path to gall?

View 0 Replies

ActionScript 2.0 :: [mx] Referencing An Odd Or Even Number

Nov 6, 2003

I am crating a roulette wheel dynamically. It has one movie clip for the numbers around the edge which it duplicates and positions correctly. My problem is that ever other number has a black background on it (on a real roulette wheel)

Is there a to distinguish between an odd number and an even number

Eg
[AS]
if (i = odd )
{

[Code]....

View 5 Replies

ActionScript 2.0 :: Referencing Multiple Mcs?

Jul 25, 2005

've created number of "total" movieclips inside "mcThumbnails" using crateEmptyMovieClip function via "for" loop.> their names are as follows: t0,t1,t2,t3,t4,...., t<total-1>> their depth is absolute starting with 500, not using getNextHighestDepth(); now i would like to remove all these created movieclips using a button onPress method

View 7 Replies







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