3 Replies Latest reply on Oct 18, 2007 11:05 AM by kglad

    replacing loadBitmap() in AS3

    macandrew Level 1
      according to the migration page in the help files, loadBitmap() has been removed from ActionScript 3 "because of the new bitmap support in ActionScript 3.0" -- well, what is that exactly? How do you load a bitmap into a bitmap object from the Library(as opposed to from an external file)? I can't find any documentation for this functionality.
      I have figured out a crude sort of method - first import a bitmap, then assign it a linkage, e.g "libasset1"
      then in AS:

      var bmap:BitmapData = new libasset1(0,0)

      ok, it works, but first of all it's a bit kludgy to have to pass in the width & height parameters when they are ignored (fortunately at least I don't have to pass in the actual width & depth of the bitmap asset!). But more of a pain is that, whereas loadBitmap took a string as an argument, this method only works with the literal - I can't reference the asset by "libasset" + i in a for/next loop, for example

      Am I missing something? Surely there's a better way!