Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Parent Of The Parent?..


Root
|---Home
| |------Container
|
|---Movie2
| |------Sub1
| | |------Sub2
| | | |------Button

How do I refer to the "Container" from the "Button"? But not through Root though, I don't want to use "_root.Home.Container".




KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 10-06-2003, 05:25 AM


View Complete Forum Thread with Replies

Sponsored Links:

Dynamically REMOVING Children From Parent Containers? MovieClip(this.parent.parent...
EDIT: actually, this isn't really dynamic... it should be really simple!

I can get a nested swf to add a movie to the root timeline, but in order to replace it with a new movie, AS3 first requires that I clear the old one. I can't figure it out!

This does not work, though it is the exact same format I use to add a movie to the root successfully:

Code:
MovieClip(this.parent.parent.parent).removeChild(MovieClip(this.parent.parent.parent).loadMovie)
Any idea why this doesn't work?

View Replies !    View Related
Referencing Parent Without Adding It To The Parent's DisplayObjectContainer
When using composition, how do I reference the parent object from the child without having added it to the parent's DisplayObjectContainter (addChild) first?

Example:

class A {
var b:B = new B();
}
NOTE: I didn't use addChild on purpose.

class B{
how do I reference A from here the way I would use 'super' to reference a superclass when using inheritance?
}

View Replies !    View Related
Relative Path: Targeting A Parent's Parent?
Does anyone know if it is possible to target a parent's parent in relative paths?

Something like this (but this doesn't work):

_parent._parent.myMovie

Thanks....

View Replies !    View Related
AddChild To This.parent.parent?
Greetings.

I have a movie clip on the main timeline called fullContainer with an instance name of fullCont_mc.

Trying to use the addChild method from a different movie clip to load a jpg into fullCont_mc .

I've traced this.parent.parent from within the 'different' movie clip to confirm it brings me to [Object MainTimeline]

I've used the following code: this.parent.parent.fullCont_mc.addChild(imageLoade r);

I'm getting the following error:
Access of possibly undefined property fullCont_mc through a reference with static type flash.displayisplayObjectContainer.

I'd think AS3 would recognize fullCont_mc by its instance name on the main timeline. What am I missing here?

Ultimately, I'm trying to use fullCont_mc as a mask for the loaded image. Please help.

Thank you for your time.

brookchef

View Replies !    View Related
OO... I Want To Be A Parent
Calling all yOOu Gurus

I am just starting to learn how to OOP.
I have an object called Frame and it has a method to draw a frame.
I now want to make a subClass of Frame which also gives me control of the lineStyle variables.
I know I could just add Thickness, RGB and Alpha to the Frame class, but I want to understand how to start a family of methods going.
I have tried the tutorial at www.debreuil.com/docs/ but dont get how to apply it to methods.

Many Thank Yous
Tim.

Code:
function Frame () {}
Frame.prototype.draw = drawFrame;
function drawFrame (x1,x2,y1,y2){
lineStyle (2,0xFF0000,100);
moveTo(x1,y1); lineTo(x1,y2); lineTo(x2,y2); lineTo(x2,y1); lineTo(x1,y1);
}
//Test it../////////
firstFrame = new frame ();
firstFrame.draw(50,350,50,150);

View Replies !    View Related
Parent
how do you call a movieclip that is one movieclip "up".. i can't remember.. i recall you could do it either by the root command or by something like "../"

thanks

View Replies !    View Related
Parent.parent.parent.parent?
Is there a easier way to get back to the main time line for a nested clip?

I have to call to a flex api fuction form a loaded swf thats in a scroll bar (I know.. but thats the way it is) I have to always do a name trace to see where I am and then once I get to the root it wont cal the function? Is there a easy way to do this?

Here is what im doing wrong


Code:
clip1.addEventListener(MouseEvent.MOUSE_UP,clip1Click);

function clip1Click(event:MouseEvent):void {

//trace("click");
trace(event.target.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.name);
trace(event.target.parent.parent.tip1.text);
trace(event.target.parent.parent.title.text);
event.target.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.AddClipping("event.target.parent.parent.title.text",event.target.parent.parent.tip1.text,"");

}
those children arnt lonely with all those parents and flash seems to be giveing instance names on the fly to some clips like instance_284 and stuff. WTF ?

Any help would be cool

View Replies !    View Related
Get Var From Parent
Hey i need to get values from a parent.
But it keeps saying the parent is a static type.
I have not set any static type.

code on DocClass

ActionScript Code:
publice var size:Number = 8

ball:Ball = new Ball();
addChild(ball);

in Ball.as

ActionScript Code:
trace(parent.size)

but i get this error
1119: Access of possibly undefined property size through a reference with static type flash.displayisplayObjectContainer.

View Replies !    View Related
Parent In Cs3 ?
Hi there

in Flash Cs3 i cant get the variables of the parent movieclip??
In flash 8 it was no problem with
_root.variable = ....;
oder parent.variable....

and now in CS3 it doesnt work? Cann anyone say me if there is another way to get the variables of the parent movieclip?

View Replies !    View Related
Parent Of The Parent?..
Root
|---Home
| |------Container
|
|---Movie2
| |------Sub1
| | |------Sub2
| | | |------Button

How do I refer to the "Container" from the "Button"? But not through Root though, I don't want to use "_root.Home.Container".

View Replies !    View Related
OO... I Want To Be A Parent
Calling all yOOu Gurus

I am just starting to learn how to OOP.
I have an object called Frame and it has a method to draw a frame.
I now want to make a subClass of Frame which also gives me control of the lineStyle variables.
I know I could just add Thickness, RGB and Alpha to the Frame class, but I want to understand how to start a family of methods going.
I have tried the tutorial at www.debreuil.com/docs/ but dont get how to apply it to methods.

Many Thank Yous
Tim.

Code:
function Frame () {}
Frame.prototype.draw = drawFrame;
function drawFrame (x1,x2,y1,y2){
lineStyle (2,0xFF0000,100);
moveTo(x1,y1); lineTo(x1,y2); lineTo(x2,y2); lineTo(x2,y1); lineTo(x1,y1);
}
//Test it../////////
firstFrame = new frame ();
firstFrame.draw(50,350,50,150);

View Replies !    View Related
Does Anyone Know About The Parent Script?
hey everyone, inside my movie i made another movie which is a jukebox and i was hoping that when you choose a song the movie that the jukebox is in would pause. i have used the parent action script before but how can i pause the origional movie then unpause within the jukebox again? thanks for your help.

View Replies !    View Related
Parent Scripts ?
Hi,
I'm trying to use action script to design a piece that has multiple accessibility options(e.g different languages, visually/aurally-impaired friendly etc)

So the template is the same but each mode calls on different variables(txt,img) to give you that mode(eg irish version-whatever)

I'm thinking parent scripts is the way forward- but I'm not an actionscript whizz like you guys.
If there's easier ways or better still- examples I could use, it would mean a lot.

Cheers.

View Replies !    View Related
Targeting Parent
Hi,

How do you target the parent (or a parent of a parent) of an instance?

I've tried

_root.name = _parent.obj; (where obj is an instance), but it doesn't give me the parents instances name.

thanks for any help

phil.

View Replies !    View Related
UnFocus Parent Swf
im making a site, in this site i have a gallery, the gallery contains thumnails that popup a window with an image or a flash movie.

the gallery works fine
the swf's in the popups work fine

BUT
the dont work together!

because when my gallery is on and the popup is on they are using to much system resources together!

how can i disable all animations and scripts in the gallery while the popup is open?

thanks,
thomas

View Replies !    View Related
Loadmovie Into Parent From MC
Hello,
The following code works great in a button on the main stage - but I now have the button in MC2 that sits in MC1 that sits on the main stage (if you follow me!!)

code:
picture.picture2.loadMovie(pictures.childNodes[0].childNodes[0].attributes["jpegURL"])


so I added a _root infront of the script to make it work but it doesn't - am I just doing something fundamentally wrong or similar???

Osc

View Replies !    View Related
Parent Problem
Hi there,

I made a simple rollover,rolloutbutton like this.Placed a button in an mc.On rollover it should play frame 2 to 12.On rollout frame 13.

Now here's the prob.At first I had a button placed inside an mc that used this code:

on(press){
_parent.noPass45 = true
this.gotoAndPlay(40)
unloadMovieNum(2);
}

But now this button would be the rollover,rolloutbutton.So it would be an mc placed inside an mc.Now the script above doesn't function.

So this is probably a _parent prob. Wright?Someone can help me out on this.

Big thx in advance,

Modulater

View Replies !    View Related
Getting Instance Name Of Parent MC?
Hi,

I have several instances of a movie clip with a button in side (amoung other things). I would to tell the function which is called by this button in the MC the instance name or something else that could identify *which* button (insance of the movie clip) has been pressed.

Does anyone know or have any suggestions on how I could do this?

Thanks.

View Replies !    View Related
How To: Swap The Parent Of A MC?
hi all,
I have got a problem in my program.

I want to change the _parent of the existed MC, from root to other MC, anyone can help me to solve the problem...@@..

description:
There are two movieclips on the stage, one is called temp_mc1, one is call temp_mc2, and I want to change the _parent of temp_mc1 from root to temp_mc2, that mean the final result I want is _root.temp_mc2.temp_mc1 instead of _root.temp_mc1, is it possible to do that without using duplicate a new movieclip??


Thanks,
Jack

View Replies !    View Related
Loading .swf Into Parent .swf
I'm trying to load a smaller .swf file into the center of a larger .swf file when a button is presses. The file keeps loading all the way to the left top. how do i make it load in the center?

View Replies !    View Related
Parent Loading
Hi,

The title I guess say it all, huh?

But just to be sure.

I have a main menu wich goes right or left. Depends what categorie you choose. When it goes left I have to load a arrow movie wich goes left and for right has to load a moviw arrow which goes right (and not wrong). Thats means that there are two movies: arow left movie and arrow right movie. And both have to react at the moving menu, which were to load and play.
So first level would be the menu which ships from right to left.
Second level (under the menu) one of the arrow movie has to load depending which direction the movie goes.

(now Im confused. What was there I wanted??? A, right!)


I figured out that maybe its more confortable to load it from the library but also if it can be loaded from external files I dont mind. (I did the container thing before so I understand it a bit.

The arrow movies are movies played in the background, as the menu remains on top all the time.

The script for animating the menu is:

onClipEvent (load) {

_root.newposition = "null";

}

onClipEvent (enterFrame) {

current = getProperty(_root.drop, _x);

if (_root.newposition<current) {

distance = current-_root.newposition;

setProperty("_root.drop", _x, current-(distance*.1));

}

if (_root.newposition>current) {

distance = _root.newposition-current;

setProperty("_root.drop", _x, current+(distance*.1));

}

}


Any help accepted.
Thanks

View Replies !    View Related
Parent/root
can anyone help me here. ive had this problem before and i just scraped through it.

this is the As for a scrolling text box. the scrolling button works but its not scrolling the text when i move it up/down.

the MC for this is inside just one Mc on the main stage. ive changed all sorts and it wont scroll the text.


onClipEvent(load){
var objetivo:String = _parent.mi_objetivo;//entre comillas aquí escribe
var sostenido:Boolean = false;
var razon:Number = this._parent._parent[objetivo]._height / this._height;
var deslizar:Number;
razon = int(razon);
}

on(press){
startDrag(this, false, this._parent.barra._x, this._parent.barra._y, this._parent.barra._x + this._parent.barra._width, this._parent.barra._y + this._parent.barra._height - this._height);
this.sostenido = true;
}

on(release){
stopDrag();
this.sostenido = false;
}

onClipEvent(mouseMove){
if(this.sostenido){
deslizar = (this._y - this._parent.barra._y);
deslizar = int(deslizar);
this._parent._parent[objetivo]._y = -(razon * deslizar) / 2;
}
}

View Replies !    View Related
How To Control A Parent MC?
I've got a complex heirarchy of MCs...say I need to put a script in MC-1.1 to gotoAndStop(1) of MC-1...so there are 2 ways to do it as to what i know, one is _root.MC-1.gotoAndStop(1); and the other is the other way around like going one step up from the child ...i know it has something to do with '/' but cant figure out the syntax..could someome help me out? Let me know if im making sense.......

View Replies !    View Related
Parent Tutorial
Hi people
I need to know where can I find a tutorial about ussing parent command, I need to control the "y movement" of a big movie trought the movement of a small movie or a button,

thanks

Dave

View Replies !    View Related
Attachsound In Parent Swf
I have a swf with sounds attached to a sound object.
When I load this swf into a (parent) main swf it won't find the sounds from the library, except when I place the sound files in the lib of the main swf.

Is there a way to have to external swf keep the sounds in it's own library so the main swf won't get burdened with these files ?

View Replies !    View Related
Parent Script Help
Hi guys, I appoligise for such a stupid question. Im not the best scripter in flash, all i need is a script that will let a button in a graphic thats also inside of a movie work. I use to have the script but i lost it, if someone would be so kind and help me out, I would really appreciate it.

Thanks
Frank

View Replies !    View Related
Parent Hittest
is it possible to create a hittest with something inside a movie clip, and the scene the movie clip is in?

View Replies !    View Related
Parent Hittest
is it possible to create a hittest with something inside a movie clip, and the scene the movie clip is in?

View Replies !    View Related
Parent Hittest
is it possible to create a hittest with something inside a movie clip, and the scene the movie clip is in?

View Replies !    View Related
Parent Hittest
is it possible to create a hittest with something inside a movie clip, and the scene the movie clip is in?

View Replies !    View Related
Parent To A Null?
Hello, I'm fairly new to Flash 8, and have a question about an effect I'm trying to achieve.

Example:

In After Effects, I can parent one object (child) to another object (parent). When I move the parent, so does the child.

How would I accomplish this with two movie clips in Flash 8?

Speficifallly, I'm scripting a tween for one object after a mouse click, but want to move a second object to move 90% of the x and y position of the first object.

I'm not sure where to start with the parenting/following bit.

The end goal is to achieve a multiplaning effect in my interface with "closer" objects moving slower than "further" objects.

thanks,

-SF

View Replies !    View Related
Parent Window Help
I have created a pop up map in flash
The code I have applied to the buttons is:

on (release) {

//Goto Webpage Behavior
getURL("http://classifieds.rgj.com/category/1682","popUpParent");
//End Behavior

}

this works great on the first click...the current browser refreshes to the url in the code. yay. however, when you click another button, the url populates the map popup window. ugh.

I have tried several variations, but nothing is working.

bottom line: I'd like all buttons to populate and refresh the parent window.

thank you in advance all flash gurus!!

View Replies !    View Related
How Do I Make A Swf The Parent Of Others?
Hi There,

I currently have three swf files: master.swf, navigation.swf and portfolio.swf. master.swf is essentially a background, navigation.swf is made up of four animated movieclips that I am using as buttons and portfolio.swf contains a simple coloured block.

I have loaded navigation.swf into my master file successfully, but I am having trouble loading my portfolio.swf into the master via the navigation.swf.

I am trying to use the image loader in my master file so that i can specify a level for the swf to display on beneath my navigation.swf, which I want to always remain on screen at the top of the stacking order.

To use the imageloader of the master file while writing code in the navigation file do I have to link them in a parent/child relationship somehow? If so how do you do this?

Here is the code in my master.fla:

Code:
var nav_btnsRequest:URLRequest = new URLRequest("navigation_btns.swf");

var nav_btnsLoader:Loader = new Loader();
nav_btnsLoader.load(nav_btnsRequest);

addChildAt(nav_btnsLoader, 1);
and here is the code that I have tried to use in my navigation.fla to load the portfolio into the master file once the relevant button is clicked:

Code:
stop();

pin_01.addEventListener(MouseEvent.CLICK, onClick_01);

function onClick_01(event:MouseEvent):void
{
pin_01.play();
var portfolioReq:URLRequest = new URLRequest("portfolio.swf");
Loader(root.parent).load(portfolioReq, 1);
}
Any ideas what i should try? Thanks all

View Replies !    View Related
Communicating With A Parent
I'm trying to communicate with a parent, but how can I do that without disabling the strict mode. One way I do is with event dispatchers, but is there another way to do it.

View Replies !    View Related
HELPadd Parent?
hi, i have a button allzones inside movieclip1 at one timeline, when i click on this button ,

i want goto frame 2 inside movieclip2 at another timeline.

how can i add parent to this button?
thanks!!

the code now i have:
function zone(e:Event){
gotoAndStop(2);
}
allzones.addEventListener(MouseEvent.CLICK,zone);

View Replies !    View Related
RemoveChild Of Parent Swf
I feel really dumb here. But, lets assume you have two swfs, loader and loadee. Lets also assume that ball_mc has been added to the display list of loader.

Now you've loaded loadee into loader and you want to call removeChild(ball_mc). But, you want to call it from the loadee. How would you do that?

I know this has a really easy answer, but googling "removeChild+parent" or other related queries don't yield helpful answers.

View Replies !    View Related
Run Function In Parent
I have been trying to run a function in a parent of a child and this is what im using:


Code:
MovieClip(this.parent).removeBall();



But i keep getting this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at rCrabL_mc/removeCrab()
at rCrabL_mc/runThis()



the function is definitely there,
help please

View Replies !    View Related
Parent Problem
I have a movieClip on the stage at runtime. Its instance name is menuHolder. I add a sprite to this movieClip and inside the sprite I did a trace for the parent and it showed up as null?

I have a document class that loads some xml like so.

Code:
package com{

import flash.display.Sprite;
import flash.events.*;
import com.menu.NavigationBar;
import com.xml.LoadXml;

public class Main extends Sprite{

private var _navBar : NavigationBar;
private var _appData : LoadXml;

public function Main() {
_appData = new LoadXml('../deploy/menu.xml');
_appData.addEventListener('xmlLoaded', onLoadXML, false, 0, true );

}

private function onLoadXML( evt : Event ) : void {
_navBar = new NavigationBar(this, _appData.xmlData );
menuHolder.addChild(_navBar);

}
}

}
My NavigationBar class looks like this.


Code:
package com.menu{

import flash.display.Sprite;

public class NavigationBar extends Sprite{

private var _main : Sprite;
private var _navData : XMLList;

public function NavigationBar( main : Sprite, navData: XML) {
_main = main;
this.name = 'menu_container';
_navData = navData.member;
build();

}

private function build() : void {
trace(" parent = "+this.parent);

for( var i : uint; i < _navData.length(); i++ ){

}

}
}
}
As you can see I'm trying to do a trace to see that my parent is actually the
menuHolder movieclip on the main stage.
The trace shows as

Quote:




parent = null




Why would parent be null when the sprite has been added to the menuHolder display list? Or am I thinking this wrong.

Thanks

View Replies !    View Related
DuplicateMovieClip To Another Parent.
Is there any possibility to duplicate MovieClip that I create and nested in one parent to another MovieClip parent.
Thanks
Ronen Tsamir

View Replies !    View Related
Loading Mp3 Into Parent Swf
hi...

basically I have an swf section to my site which is a virtual stereo......

problem is as i load off this page i want the music the users chosen to still be running once they unload this file...

so what i need is the coding for a frame... which will make flash stream an mp3 but into the parent swf not the child thats got the controls...

please say this is possible..

love u guys =D

View Replies !    View Related
Parent Object
Hi all.

I have written a cript that has about 480 lines of code and I'm trying to prevent it from multiplying, so I came around an issue I need to sole (but couldn't).

The easiest way of explaining the situation is, I'm trying to find the parent of an object, like

parent_obj = new Object();
parent_obj.child_obj = new Object();
var cur:Object = new Object();
cur = parent_obj.child_obj;

How can I reach "parent_obj" from "cur" (or from "parent_obj.child_obj")? I have 13 functions that call one another (sometimes itself after a variable change) and I'm using the object as the parameter. There's one condition that all these functions need the parent object as the 2nd parameter, but...

Thanks in advance.

View Replies !    View Related
Parent And Child Swf
Hi,
Can anyone help please, I basically just want to call my main (parent) swf from the current clip (child) am in.
I just don't know how to write it, having a blank right now, it must be in the code line below, where i need to somehow add the name of the swf to the name of the button:
_root.but._visible = true;

Here is it in a bit more detail if needed:
I have 2 swfs, one is the main one that has buttons in it, when this button is clicked it loads a new semi transparent swf on top of it into an empty clip in my parent swf. When doing that I make the button in the parent swf invisible.
I have one close button which sits in the semi transparent swf on top, when this button is pressed it unloads itself and reveals the parent swf underneath again.
Now I want to add a line into my function that makes the button I previously made invisible, visible again so I can use it again, preferably when pressing the unload button of my semi transparent swf on top.

This is the parent swf clip function:
but.onRelease = function() {
trace(this._name+"._visible = false");
this._visible = false;
empty.loadMovie("top.swf");
};


This is top swf clip:
close_btn.onRelease = function() {
unloadMovie("");
trace(this._name+"._visible = true");
_root.but._visible = true;
};

View Replies !    View Related
How Does As3 Get It's Parent's Domain?
how to decide in which domain the app is reside using as3 ?
ip address also works!

thanks a lot !

View Replies !    View Related
.root Or .parent?
i've got code nested in a movieclip on the stage.

i'm calling to a function that's in an external .as file on the main timeline.

its saying the functions i'm calling from within the movieclip don't exist.

what's the path back to the main timeline?

for instance in AS2 it would have been like:
root.enableButtons(begin_btn); or _parent.enableButtons(begin_btn);

how do i get back to the main timeline to call that function?????

THANKS!!

View Replies !    View Related
Parent Of Movieclip
May be one more time, but I cannot find here how can I change parent of MovieClip?

View Replies !    View Related
Variable Value In Parent
I am trying to get the value of a variable located 2 parents up.

this code is on the halfway point of the button MC timeline.
thumb1 it is called.

thumb1 sits inside a movie clip called siteContainer


ActionScript Code:
this.addEventListener(Event.ENTER_FRAME, buttonSpin);

function buttonSpin(){
    if (parent.parent.btnLoop == true){
        stop();
        } else {
            play();
        }
}

thanks

View Replies !    View Related
Parent.getNextChild()
imagine this hierarchy:


ActionScript Code:
myParent.addChild(myFirstChild);
myParent.addChild(mySecondChild);

now let's say i'm in a function and i have as an arguement the (MovieClip) myFirstChild. How can i set another variable to be the parent's next child from there?
I guess i would love something like myFirstChild.parent.getNextChild();

Any ideas how to implement that?

View Replies !    View Related
Can't Use Parent Or Root
Hey everyone!

Please help me - For some reason when using this code:


Code:
stop();
enter.addEventListener (MouseEvent.MOUSE_OVER, link1MouseOver);
enter.addEventListener (MouseEvent.MOUSE_UP, link1MouseUp);

// Functions

function link1MouseOver (event:MouseEvent):void
{
enter.buttonMode = true;
}

function link1MouseUp (event:MouseEvent):void

{

}
parent.play();
I get this error:

(Line 17)

Code:
1061: Call to a possibly undefined method play through a reference with static type flash.display:DisplayObjectContainer.
When deleting the last line, parent.play(); it works fine.
It seems that I can't use parent.

If I change parent.play(); to _parent.play(); it says:

Code:
1120: Access of undefined property _parent.
Please help.

Thanks

View Replies !    View Related
How To Have Access To Parent MC?
How can I access to the stage or to a parent MC from a child MC?

View Replies !    View Related
Parent Class
If you have a swf A and it loads Swf B as a child, how would swf B access a public function defined in Swf A?

Example SWF A Doc Class:


ActionScript Code:
package {

    import flash.events.*;
    import flash.display.*;
    import flash.net.*;
    import flash.events.*;

    public class Common extends MovieClip {



        public function Common() {



           
                             stage.addEventListener(MouseEvent.CLICK, myTrace);



        }

            public function myTrace(event:MouseEvent):void {
               
                trace("Clickity Click Click");
               
            }
    }
}

How would i access myTrace in SWF B ?

View Replies !    View Related
More Issues With Parent
Disregard this post, as I figured it out. I forgot to addChild my object.

Dang it, I've got more issues with parent variables. Please have a look at where I try to reference this.parent.parent.gameInfo.sepLosses below. Is there some problem with me using "this"? The path is correct. I am trying to access the variable of a child of my parent's parent.


ActionScript Code:
package
{
    import flash.display.*;
    import flash.events.*;
    import flash.utils.Timer;
    import flash.media.Sound;
    import flash.net.URLRequest;


    public class RunOut extends Sprite
    {
        var soundConflict:Sound;
        var soundConflictReq:URLRequest;
        var conflictStatus:Boolean = false;

        public function RunOut()
        {
            soundConflictReq = new URLRequest("sounds/soundConflict2.mp3");
            soundConflict = new Sound();
            soundConflict.load(soundConflictReq);
        }
       
        function conflict(aircraftOne, aircraftTwo):void
        {
            if (conflictStatus == false)
            {
                conflictStatus = true;
                trace("Conflict between "+aircraftOne.parent.ident+" and "+aircraftTwo.parent.ident);
                this.parent.parent.gameInfo.sepLosses += .5;
                trace(this.parent.parent.gameInfo.sepLosses);
                //soundConflict.play();
            }
        }
        function resolution():void
        {
            conflictStatus = false;
        }
    }
}

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved