Loading image into bitmapdata

  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

Hi

I am loading bitmapdata from the library like this

linkageId = "landscape";
myBitmapData = BitmapData.loadBitmap(linkageId);

Than attach this bitmap image to a movie.

mc = this.createEmptyMovieClip("mc", 0);
mc.attachBitmap(myBitmapData, 0);

Can someone give me the code to load my image using loadMovie instead of from libarary and attach it to movie clip mc.
  • Belk Media Group
  • Graphic Monk
  • Professor
  • User avatar
  • Posts: 777
  • Loc: In the heart of California, Fresno.

Post 3+ Months Ago

Code: [ Select ]
loadMovie ("image.jpg", InstanceNameHere);


I think thats what you want. This piece of script will load an external image into a specific movie clip.
  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

Thats not my problem, I am already using the loadMovie like this
mc.loadMovie("image.jpg") and it works fine. I want to load this image into bitmap first and than attach it to the moive. Can I do this.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

You can do it the other way around.

BitmapData.loadBitmap only applies to the library, BitmapData doesn't have an external loading method, but it does have a draw method that can copy the bitmap representation of a MovieClip to a BitmapData object.

This isn't exact code, as you can see the loading is incomplete, it's only meant to show the order of what must be done to achieve this.

Code: [ Select ]
mc.loadMovie("image.jpg");
bmd.draw(mc);
alterBitmapData(bmd);
mc.attachBitmap(bmd, 0);
  1. mc.loadMovie("image.jpg");
  2. bmd.draw(mc);
  3. alterBitmapData(bmd);
  4. mc.attachBitmap(bmd, 0);

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.