Ticket #629 (closed enhancement: fixed)
Fix snapshot plugin for 5.0
| Reported by: | jeroen | Owned by: | jeroen |
|---|---|---|---|
| Priority: | Milestone: | Plugins | |
| Component: | Keywords: | ||
| Cc: | pablo | Forum thread: |
Description
The snapshot plugin does a view.skin.stage call, which isn't there anymore in 5.0. There should be a way to get to the media element though, by walking the display stack.
Change History
comment:3 Changed 4 years ago by jeroen
- Cc pablo added
Fixed this for both 5.0 and 4.1 / 4.4 by introducing a little version switch. Very nasty, but it seems to be the only way to get this plugin to work, since there's no API call for it:
/ Grab the video object - nasty hack that depends on player version. / private function videoObject():DisplayObject {
var ply:String = view.configversion?.substr(0,3); switch (ply) {
case '4.6': case '4.7':
return view.skin.display.media.getChildAt(0) as DisplayObject;
case '4.5':
return view.skin.display.media as DisplayObject;
case '4.4': case '4.3': case '4.2': case '4.1':
view.skin.display.media.mask = null; return view.skin.display.media as DisplayObject;
default:
var skn:Sprite = RootReference.stage.getChildAt(0) as Sprite; return Sprite(skn.getChildAt(1)).getChildAt(0) as DisplayObject;
}
};

The officially hacky way to get to the root in 5.x is:
This can be found in View.as ...