addChild() returns a DisplayObject reference - it's probably best to store this in its own property and do the lookup that way.

Raju Bitter wrote:
Hi all,

In videoview I need to replace the following functionality for SWF9:

mc = this.immediateparent.sprite.attachResourceToChildView("__LZvideo",
this.sprite);
this.sprite.setMovieClip(mc);

For SWF9, instead of attaching a movieclip to sprite we need create a Video
object. I can attach that to the sprite using sprite.addChild, but what I'm
missing is the functionality to attach it using the property name __Lzvideo.

if ($swf8) {
  // no other subviews should be allowed (todo: schema)

  mc = this.immediateparent.sprite.attachResourceToChildView("__LZvideo",
this.sprite);
  this.sprite.setMovieClip(mc);
} else if ($swf9) {
  var vid = new Video(width = this.width, height = this.height);

  vid.attachNetStream(this.stream);

  this.stream.play(this.url);

  this.sprite.addChild(vid);
}

In the method _getflashvideo() the __LZvideo property for for the movieclip
is accessed again:
function _getflashvideo () {
  return this.__LZmovieClipRef.__lzvideo;
}

Is there a way to add a child to a sprite in SWF9 using a property name like
"__LZvideo"?

Thanks,
Raju



--
Regards,
Max Carlson
OpenLaszlo.org

Reply via email to