Thank you so much!
private function onItemClick(e:Object):Void
{
_parent.loadVideo(e.target.id);
}
private function newSection(whichVid:Number):Void
{
_parent.loadVideo(whichVid);
trace("this trace is: " + this);
trace("this._parent trace is: " + this._parent);
}
Both traces return an undefined. How is that possible?
Thank you!
private function onItemClick(e:Object):Void
{
TweenLite.to(this.white_out, aniTime2, {_alpha:100, overwrite:0,
onComplete:newSection, onCompleteParams:[e.target.id]});
}
And if I trace the Params from inside the other function I get the right
values, so it seems that they are coming through.
in your onCompleteParams send a reference to your class ("this") and use that
in newSection():
private function onItemClick(e:Object):Void
{
TweenLite.to(this.white_out, aniTime2, {_alpha:100, overwrite:0,
onComplete:newSection, onCompleteParams:[e.target.id,this]});
}
private function newSection(whichVid:Number,yourclassRef:YourClass):Void
{
yourclassRef._parent.loadVideo(whichVid);
}
Thank you!!!
and i had a lot of trouble "getting" it, too. it's certainly not the easiest thing to fully grasp. (but once you get it, things are much easier when using oop.)