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


Similar Posts:


IDE :: Referencing Sprite From Within .as File

Nov 12, 2009

Basically I guess it is a reference problem I do have. (1120: Access of undefined property images) For an image gallery I also do have a few text sprites which may have to much text for one side to display. Therefore I do have a scrollbar placed next to the text which should be able to move my text sprite within its mask. My .fla at one point adds an InfoText (InfoText.as, extends Sprite) to an already existing sprite "images".

[Code]...

So, how do I point my line of code responsible for moving the textContainer from within Scrollbar.as at the textContainer sprite? Running against a wall since the last 6 hours and couldn't find any proper tips on the web.

View 5 Replies

ActionScript 3.0 :: Referencing The MainTimeLine From A File?

Apr 25, 2011

I have almost everything working as confirmed through tracestatements, but when I insert my gotoAndStop("frame labels") in theAS file, there is no effect on the app.I know the button is working because inside the AS file I amtracing the button name to the output panel and it is correct. Ialso have assigned a Switch Statement to the clicked event in theAS file and that is correct also. It traces the correct outputs.But inside the Switch statement, where the gotoAndStop islocated it is not moving to the frame label. It doesn't move atall.I have tried the following:

this.gotoAndStop("label");
stage.gotoAndStop("label");
root.gotoAndStop("label");
this.stage.gotoAndStop("label");

View 4 Replies

ActionScript 3.0 :: Referencing A Variable On The Main Timeline From A .as File

Sep 2, 2010

I am having problems referencing a variable on the main timeline in a .as file using root.variable.

[Code]....

View 6 Replies

ActionScript 3.0 :: SoundManager - Pausing Sound By Referencing Code In Separate File?

May 22, 2009

I wanted to have this Zombie Penguin enemy use a walk sound (it would be odd if he moved and was silent) but because it is initializing the whole world, simply coding the sound into his animation state won't work because it will play the sound for every existing Zombie Penguin in the world, not just the one on the screen.

Now I've tried to get around this problem by using a SoundManager class [URL] to load and play/pause the sound when necessary. I've got this working by placing a movieclip above the world and hittesting everything and when it finds a Zombie Penguin activates the SFX. If it finds the enemy and you leave the room or kill the enemy (basically any way it is removed from the screen) it will pause the sound (not stop) and then unpause if you go back/find another instance of that enemy.

The problem is, though, that if I STUN the enemy (not kill it) it plays it's dizzy animation (which consists of hit sitting down with stars spinning around it's head) the walking SFX continues to play as the enemy is still on the screen.Now in the Zombie Penguins .as file it has a boolean that for being stunned or not (bStunned), and a function (public function getZPStun():Boolean -- returns bStunned). this bStunned boolean is set to a default of false.I figure that I just have to reference that somewhere in the following code, but I'm not sure where. The Zombie Penguin's .as is ZPEnemy, so I'm calling it like so:

ZPEnemy.getInstance().getZPStun()

I've tried calling it as part of an if statement a in a number of placesin hopes that calling it will relate the current state of the bStunned boolean, but I can't seem to get it to work.

Code:

var bNotPenguin = true;
for(var i = 0; i<this.numChildren; i++) //** Sound Manager Coding (May 15)
{

[code]....

View 4 Replies

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 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 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

ActionScript 2.0 :: Referencing A MC From AttachMovie

Mar 23, 2007

I'm confused as to how to reference a movieclip after using the attachMovie method. Here is my code:

[Code]...

View 1 Replies

ActionScript 2.0 :: Referencing The Xml Values?

Jun 13, 2007

I can get it to display a chosen club name by setting the variable var1, but I need it so users can click different movieclips to select which club they want (ie change the value of var1)Also I realise as it is at the moment this will not be possible as its only calling displayContent when it initially loads up.

Code:
///////////// Get XML Info /////////////
function loadXML(loaded) {
if (loaded) {
_root.xmlNode = findNode(this, "teams");z

[code]....

View 3 Replies

ActionScript 2.0 :: Referencing To An HTML Value?

Jan 14, 2009

I'm making a sports roster for my school's website and I want to use actionscript to save me time updating. Is there a way I can use actionscript to "reference" to a value (<td uV="1.000" class="ig_a78ff5c6_6 StatsField"><nobr>1</nobr></td>) on a webpage (http://www.maxpreps.com/michigan/bas...th=,local,team) so that when the value is updated, it would reflect on my roster?

View 4 Replies

IDE :: Referencing A Global Var Within A Function

Apr 18, 2009

I'm an old C programmer been away from programming for years. Now we have a project requiring Flash and I've been elected. Just installed CS4. I have 16 panels in 4 sets of 4 that rotate left to right. (Big learning curve on that one - fading transitions in the right order...). Each panel must have a unique url when clicked. (16 urls).I've looked through many solutions, most of which seem unduly complex. I think that the simplest short of going to onRelease() with AS2 (Later I have to add mouseover changes in the graphics) is something like this:[code]I haven't found this solution out there. Is there a gotcha because the a#Link vars are accessed as global within the scope of handleLink? It doesn't feel right, but it works fine and 16 global variables doesn't seem too bad.

View 2 Replies

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

ActionScript 1/2 :: Scripts Referencing Their Own MC?

May 27, 2010

How can you get a script on a clip to reference its own clip?'this' seems to only return the path up to, but not incuding the button.For example, say I want a movieclip to delete itself when clicked, but I don't know the name of the clip:(Or self-reference anything in a dynamicaly created MC)
 
on (release) {
this.removeMovieClip();
}
 
Obviously, this doesn't work.I've worked around this problem by inserting the script on a transparent MC inside the target clip - on top of any other goodies that happen to be in the clip. This gives me a layer to click that doesn't hide the other stuff, and 'this' refers to the correct item to delete, letting the above script work.But this seems a clunky way to do it, and I think the transparent layers are causing a performance hit.

View 4 Replies

ActionScript 3.0 :: How To Referencing The Stage

Feb 2, 2011

I'm trying to reference the stage from my view class(AsteroidSuppyView). The view is a child of the document class. I'm tryng diffferent ways to do this but i'm getting the error:Code:1152: A conflict exists with inherited definition flash.display:DisplayObject.stage in namespace public.my view class is:

Code:
package
{

[code].....

View 2 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 :: F8 - Referencing MovieClip After Attaching It

Feb 17, 2009

I'm having issues trying to reference a movieClip after attaching it. What I have is:
Code:
btn_instructions.onRelease = function() {
instructions = true;
attachMovie("parchment", "mc_parchment", getNextHighestDepth(), { _x:280, _y:280 });
} mc_parchment.btn_close.onRelease = function() {
instructions = false;
trace("close");
removeMovieClip(mc_parchment);
}

The first is creating it on top of the other items that are created during the game. I can't have the instructions on the timeline and just change the visibility of it due to all the assets this game is making. The instructions variable is used in an if statement elsewhere in the game to lock the user controls so they can't create anything else in the game while your viewing the instructions. The second function is the one that should close it. The movie clip that's attached has a button in it, with the instance name btn_close. The trace doesn't even pop up so it's not targeting it correctly. Yet when I go to 'debug' and 'list objects' both mc_parchment and mc_parchment.btn_close are listed as being in the scene after clicking the instructions button.

View 2 Replies

ActionScript 3.0 :: Referencing A Library Class?

Mar 17, 2009

In As 2 you were able to reference a linkage ID using a string.Example

Code:
var strName = 'home';
attachMovie(strName+'_mc', strName, 1);

[code].....

View 3 Replies

Flash8 :: Searching / Referencing XML Tags

Jul 2, 2009

Does anyone know of an easy way to use the data from a combo box to either search or reference the XML tags? I have an xml document formatted like this:

[Code]...

Ultimately, I would like to use the data from the combo box to find/reference the information contained in the Brand tags so I can display the information in the remaining tags (stuf1, stuf2, stuf3 & stuf4) in separate text fields.

View 21 Replies

Actionscript 2.0 :: Referencing Sharedobject From Another Movie?

Aug 18, 2009

I created a movie, which is some form of a a code generator. In that movie i save a a generated code using sharedobject.

(code in code generator movie)
var myaccess:SharedObject = SharedObject.getLocal("Lesson1");
myaccess.data.mycode = pass.text;
myaccess.flush();

Here is my problem, i want to use this created sharedobject on another, separate movie clip, is that possible?Or are sharedobjects just work on their original movie clips?

(code in separate movie)
var myaccess2:SharedObject = SharedObject.getLocal("Lesson1"); // declared a variable for holding the data from
sharedobject to see if it will load the data
txt.text = myaccess2.data.mycode // Load failed, txt.text displays undefined

View 3 Replies

ActionScript 3.0 :: XML Node Referencing A MovieClip

Aug 28, 2009

Is it possible to make a reference to a MovieClip in an XML object. It doesn't seem to be working with this code.[code]

View 2 Replies

ActionScript 3.0 :: Referencing Movieclip In Game

Sep 20, 2009

var xBoard:Number = Math.floor(mouseX/cellSize);
var yBoard:Number = Math.floor(mouseY/cellSize);
if (board[(yBoard-1)][xBoard] == 0)
{
root.getChildByName("b"+(yBoard-1)+xBoard).alpha = .7;
}

I want to be able to call various movieclips I have arranged in a grid from these two variables (xBoard and yBoard). They get new values every time I click on my gameboard.

Basically I check if they space ahead of the unit is empty. If it is I want the alpha of that space to change designating you can move there. The movieclips are arranged in a grid and named b00 (top left) to b77(bottom right).

This is the error message:

1061: Call to a possibly undefined method getChildByName through a reference with static type flash.displayisplayObject.

If I take out the getChildByName... root.("b"+(yBoard-1)+xBoard).alpha = .7;
This is the error message:

TypeError: Error #1123: Filter operator not supported on type Game_fla.MainTimeline.
at Game_fla::MainTimeline/test()

View 1 Replies

ActionScript 3.0 :: Referencing A SWF Playing As A Child Of A MC?

Jun 7, 2010

OK. I have an empty MC sittin on the stage named "M1_mc".

In the first frame I have:

Code:
var movieOne:Loader = new Loader();
M1_mc.addChild(movieOne);
movieOne.load(new URLRequest("movie1.swf"));

At this point, the external swf is playing.

How do I control the child SWF playing? Let's say i wanted to stop() or gotoAndPlay(x) within its timeline?

View 1 Replies

ActionScript 3.0 :: Referencing Loaders In An Array?

Jun 28, 2010

I have a project that needs 4 levels of zoom, each with its own image loading in. So, to make things easier on myself, I made an array of the Loaders, so I can instantiate them and hide/display them when I need toHowever, this doesn't work as I had expected. I.e. (using just two level for simplicity):

Code:
private var photo:Loader;
private var photoLarge:Loader;

[code].....

View 4 Replies







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