[Laszlo-dev] Attaching movie clips to sprites in SWF9 using a property name

Raju Bitter openlaszlonaut at googlemail.com
Fri Aug 8 15:16:53 PDT 2008


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




More information about the Laszlo-dev mailing list