Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Nested Objects

0 views
Skip to first unread message

Graeme Hoffman

unread,
Sep 4, 2001, 6:52:43 PM9/4/01
to

I'm having trouble with nested code-based objects such the following :

onClipEvent (load) {

var myHouse = new House();


function House () {
this.myKitchen = new Kitchen ();
this.clean = HClean;
this.sell = HSell;
}


function HClean() {
this.myKitchen.mopTheFloor();
}


function Kitchen() {
...
this.mopTheFloor = KMopTheFloor;
...
}

function KMopTheFloor() {
...
if (done) {
_parent.sell(); // this is where I'm confused
// I want to access myHouse not a movie clip
}
...
}

}

The confusion I'm having is how to maneouvre through the object
structure. Is there an equivalent to the _parent keyword? Yes see... I
was using _parent but have reason to believe that it's causing some
issues. Let me know if you have any leads. This problem has consumed
me for a while.

Thanks in advance,
Graeme

alchemy

unread,
Sep 4, 2001, 1:16:07 PM9/4/01
to
Actually change it to:

myHouse.sell;


"alchemy" <in...@alienalchemy.com> wrote in message
news:9n32pq$e20$1...@forums.macromedia.com...


> onClipEvent (load) {
>
> var myHouse = new House();
>
>
> function House () {
> this.myKitchen = new Kitchen ();

> this.clean = HClean();
> this.sell = HSell();
> }
>
>
> function HClean() {
> this.myKitchen.mopTheFloor();
> }
>
> function HSell(){
> // code - do something


> }
>
> function Kitchen() {
> ...
> this.mopTheFloor = KMopTheFloor;
> ...
> }
>
> function KMopTheFloor() {
> ...
> if (done) {

> myHouse.sell(); // reference the sell method of the myHouse object
>
> // _parent.sell(); // this is where I'm confused


> // I want to access myHouse not a movie clip
> }
> ...
> }
>
> }
>
>
>

> "Graeme Hoffman" <knox-...@wannado.fr> wrote in message
> news:knox-chloe-EA0E2...@forums.macromedia.com...

alchemy

unread,
Sep 4, 2001, 1:14:39 PM9/4/01
to
onClipEvent (load) {

var myHouse = new House();


function House () {
this.myKitchen = new Kitchen ();

this.clean = HClean();
this.sell = HSell();
}


function HClean() {
this.myKitchen.mopTheFloor();
}

function HSell(){
// code - do something
}

function Kitchen() {


...
this.mopTheFloor = KMopTheFloor;
...
}

function KMopTheFloor() {
...
if (done) {

myHouse.sell(); // reference the sell method of the myHouse object

// _parent.sell(); // this is where I'm confused


// I want to access myHouse not a movie clip
}
...
}

}

"Graeme Hoffman" <knox-...@wannado.fr> wrote in message
news:knox-chloe-EA0E2...@forums.macromedia.com...
>
>

0 new messages