Incredibly annoying and maddeningly simple task: get embedded bitmap
Alias Cummins <alias-JB2BhvSi7AJWk0Htik3J/[email protected]> Tue, 20 Jul 2010 16:09:48 +0100
| Newsgroups | gmane.comp.web.flash.osflash.general,gmane.comp.web.flashcoders.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi guys! It's along time since I've been on here, I hope there's someone still listening... Anyway, this is frustrating. I have some bitmap assets in a .fla file, and I want to add them to the stage. Simplest thing ever, right? Seemingly not... There are so many different ways to do this, and they all seem to end in type coercion errors. I am beginning to get annoyed. So I have the following setup: Flash IDE (CS4) library item, with base class flash.display.BitmapData, and a unique name: let's say Asset01 (there are several instances of similar but not the same assets, and I don't want to get into messing around with loaders and XML and whatnot) In actionscript I have the following: AssetBaseClass (which extends BitmapData) AssetContainer (which extends Sprite) I've tried various approaches. However, when I try to compile, I get either: TypeError: Error #1034: Type Coercion failed: cannot convert Asset01@xxxxxxxx to flash.display.DisplayObject. or one of the errors to do with the default constructor, or lack thereof. All I want to do is get an embedded bitmap from the library and attach it to the stage! Surely this is a simple task? Any pointers towards fully self contained examples or tutorials would be very much appreciated. Cheers, Alias