Difference between revisions of "Actionscript 3 Snippets"
From Wikicliki
(3 intermediate revisions by the same user not shown) | |||
Line 21: | Line 21: | ||
== removeChild == | == removeChild == | ||
− | + | <pre> removeChild(video_holder);</pre> | |
will return this error: | will return this error: | ||
− | + | <pre> ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. | |
at flash.display::DisplayObjectContainer/removeChild() | at flash.display::DisplayObjectContainer/removeChild() | ||
at tanah_1920x1080_v5b_fla::gedung_vid_17/closeVideo1()[tanah_1920x1080_v5b_fla.gedung_vid_17::frame1:50] | at tanah_1920x1080_v5b_fla::gedung_vid_17/closeVideo1()[tanah_1920x1080_v5b_fla.gedung_vid_17::frame1:50] | ||
− | at tanah_1920x1080_v5b_fla::MainTimeline/menu_press()[tanah_1920x1080_v5b_fla.MainTimeline::frame1:184] | + | at tanah_1920x1080_v5b_fla::MainTimeline/menu_press()[tanah_1920x1080_v5b_fla.MainTimeline::frame1:184]</pre> |
+ | BUT | ||
− | BUT | + | <pre> if( container.contains( video_holder) ){ container.removeChild( video_holder ); }</pre> |
+ | |||
+ | WILL WORK!! BUT I DON'T KNOW WHY? | ||
− | + | == See Also == | |
− | + | [[Category:Programming]] |
Latest revision as of 02:39, 12 July 2013
Useful AS3 Snippets
Contents
Fullscreen
import flash.display.*; stage.displayState = StageDisplayState.FULL_SCREEN; stage.scaleMode = StageScaleMode.SHOW_ALL; // SHOW_ALL or NO_SCALE stage.align = StageAlign.TOP_LEFT; fscommand("fullscreen", "true"); fscommand("allowscale", "true");
No Cursor
import flash.ui.Mouse; // Mouse.show(); - optional line Mouse.hide();
removeChild
removeChild(video_holder);
will return this error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() at tanah_1920x1080_v5b_fla::gedung_vid_17/closeVideo1()[tanah_1920x1080_v5b_fla.gedung_vid_17::frame1:50] at tanah_1920x1080_v5b_fla::MainTimeline/menu_press()[tanah_1920x1080_v5b_fla.MainTimeline::frame1:184]
BUT
if( container.contains( video_holder) ){ container.removeChild( video_holder ); }
WILL WORK!! BUT I DON'T KNOW WHY?