0
string to object bitmap conversion
Community Beginner
,
/t5/animate-discussions/string-to-object-bitmap-conversion/td-p/5064950
Apr 23, 2013
Apr 23, 2013
Copy link to clipboard
Copied
Hello:
How can I convert a string to an object bitmap?
Thank you.
With this I get error:
var f1:String ="photo1";
var img:Object=f1;
var foto1:BitmapData = new img(0,0);
var foto1_stage:Bitmap = new Bitmap(foto1);
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/string-to-object-bitmap-conversion/m-p/5064951#M134326
Apr 23, 2013
Apr 23, 2013
Copy link to clipboard
Copied
what is "photo1"?
is that the class name of a bitmapdata object?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
anjemalo1
AUTHOR
Community Beginner
,
/t5/animate-discussions/string-to-object-bitmap-conversion/m-p/5064952#M134327
Apr 23, 2013
Apr 23, 2013
Copy link to clipboard
Copied
I mistake an error.
I have in the library:
Photo1
Photo2
Photo3
etc,
linked to actionscript
I need to convert string "Photo"+ 1 to an object
I need to convert string "Photo"+2 to an object
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/animate-discussions/string-to-object-bitmap-conversion/m-p/5064953#M134328
Apr 23, 2013
Apr 23, 2013
Copy link to clipboard
Copied
use:
var c:Class=Class(getDefinitionByName("Photo1"));
var c:*=new c();
// and, if those are bitmapdata class objects, possibly:
var bmp:Bitmap=new Bitmap(c);
addChild(bmp)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

