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