Re: [Flashcoders] Load external bitmap into bitmapdata?

2006-03-07 Thread James Deakin
Wow thats great

On 3/7/06, Adrian Park <[EMAIL PROTECTED]> wrote:
> Awesome! Thanks Jesse/JesterXL. I love finding out I'm wrong when there is a
> better way :)
>
>
> On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:
> >
> > Indeed, it works!,
> > Also, trying this i´ve found a method to attach loaded movies as
> > bitmaps... now i can create libraries of MCs!!
> >
> > Thanks!
> >
> > On Mon, 06 Mar 2006 19:50:24 -0300, JesterXL <[EMAIL PROTECTED]>
> > wrote:
> >
> > > I started to eat a cup, but it really didn't taste so good.  Suddenly,
> > my
> > > mouth really hurt trying to voraciously chew on ceramics, thus I gave up
> > > upon realising cups don't taste so good.
> > >
> > > ...however, this code in fact works:
> > >
> > > import flash.display.BitmapData;
> > > import flash.geom.Rectangle;
> > > import flash.geom.Matrix;
> > > import flash.geom.ColorTransform;
> > >
> > > function init()
> > > {
> > >  Stage.align = "TL";
> > >  Stage.scaleMode = "noScale";
> > >
> > >  createEmptyMovieClip("image_mc", 0);
> > >
> > >  var mcl:MovieClipLoader = new MovieClipLoader();
> > >  mcl.addListener(this);
> > >  mcl.loadClip("test.jpg", image_mc);
> > > }
> > >
> > > function onLoadInit(target)
> > > {
> > >  var width:Number = image_mc._width;
> > >  var height:Number = image_mc._height;
> > >  var transparent:Boolean = false;
> > >  var fillColor:Number = 0x;
> > >
> > >  var myBitmapData:BitmapData = new BitmapData(width, height,
> > transparent,
> > > fillColor);
> > >  myBitmapData.draw(image_mc, new Matrix(), new ColorTransform());
> > >
> > >  createEmptyMovieClip("copy_mc", 1);
> > >  copy_mc._x = 20;
> > >  copy_mc._y = 20;
> > >  copy_mc.attachBitmap(myBitmapData, 0);
> > >
> > >  image_mc._alpha = 20;
> > > }
> > >
> > > init()
> > >
> > > - Original Message -
> > > From: "Marcelo Volmaro" <[EMAIL PROTECTED]>
> > > To: "Flashcoders mailing list" 
> > > Sent: Monday, March 06, 2006 5:38 PM
> > > Subject: Re: [Flashcoders] Load external bitmap into bitmapdata?
> > >
> > >
> > > The problem is: I need to load a bitmap. I can´t embed the bitmap inside
> > > a
> > > swf, because i have no control over the bitmaps.
> > > Any other ideas?
> > >
> > > On Mon, 06 Mar 2006 17:36:46 -0300, Adrian Park <[EMAIL PROTECTED]>
> > wrote:
> > >
> > >> Hey Marcelo,
> > >>
> > >> I've been playing with BitmapData for the first time this past weekend
> > >> so I
> > >> stand to be corrected on what I'm about to say!
> > >>
> > >> My understanding is that you can only load BitmapData from an existing
> > >> image
> > >> which is already in your library and has a linkage ID. For this reason,
> > >> I
> > >> don't think you can load an image and get its BitmapData. I was
> > thinking
> > >> there might be a workaround though...
> > >>
> > >> I was going to try embedding the jpg/png/gif in an swf and giving it a
> > >> linkage id in the library, then load that swf into your master movie
> > and
> > >> attach the BitmapData from the loaded swf's library.
> > >>
> > >> Possible issues? I know you can't attach library assets from a loaded
> > >> swf
> > >> into another swf so the same limitation may apply with BitmapData.
> > >> Again, I
> > >> thought a workaround for this might be to attach the BitmapData into
> > the
> > >> swf
> > >> you've just loaded and then clone it to a BitmapData object elsewhere?
> > >>
> > >> As you can see, I've been doing a lot of thinking and not a lot of
> > doing
> > >> so
> > >> I'm not sure if this is of any help at all!
> > >>
> > >> I'd be very interested to know if any of this works.
> > >>
> > >> Cheers, Adrian P
> > >>
> > >> On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:
> > >>>
> > >>> Hi list!,
> > >>>
> > >>

Re: [Flashcoders] Load external bitmap into bitmapdata?

2006-03-07 Thread Adrian Park
Awesome! Thanks Jesse/JesterXL. I love finding out I'm wrong when there is a
better way :)


On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:
>
> Indeed, it works!,
> Also, trying this i´ve found a method to attach loaded movies as
> bitmaps... now i can create libraries of MCs!!
>
> Thanks!
>
> On Mon, 06 Mar 2006 19:50:24 -0300, JesterXL <[EMAIL PROTECTED]>
> wrote:
>
> > I started to eat a cup, but it really didn't taste so good.  Suddenly,
> my
> > mouth really hurt trying to voraciously chew on ceramics, thus I gave up
> > upon realising cups don't taste so good.
> >
> > ...however, this code in fact works:
> >
> > import flash.display.BitmapData;
> > import flash.geom.Rectangle;
> > import flash.geom.Matrix;
> > import flash.geom.ColorTransform;
> >
> > function init()
> > {
> >  Stage.align = "TL";
> >  Stage.scaleMode = "noScale";
> >
> >  createEmptyMovieClip("image_mc", 0);
> >
> >  var mcl:MovieClipLoader = new MovieClipLoader();
> >  mcl.addListener(this);
> >  mcl.loadClip("test.jpg", image_mc);
> > }
> >
> > function onLoadInit(target)
> > {
> >  var width:Number = image_mc._width;
> >  var height:Number = image_mc._height;
> >  var transparent:Boolean = false;
> >  var fillColor:Number = 0x;
> >
> >  var myBitmapData:BitmapData = new BitmapData(width, height,
> transparent,
> > fillColor);
> >  myBitmapData.draw(image_mc, new Matrix(), new ColorTransform());
> >
> >  createEmptyMovieClip("copy_mc", 1);
> >  copy_mc._x = 20;
> >  copy_mc._y = 20;
> >  copy_mc.attachBitmap(myBitmapData, 0);
> >
> >  image_mc._alpha = 20;
> > }
> >
> > init()
> >
> > - Original Message -
> > From: "Marcelo Volmaro" <[EMAIL PROTECTED]>
> > To: "Flashcoders mailing list" 
> > Sent: Monday, March 06, 2006 5:38 PM
> > Subject: Re: [Flashcoders] Load external bitmap into bitmapdata?
> >
> >
> > The problem is: I need to load a bitmap. I can´t embed the bitmap inside
> > a
> > swf, because i have no control over the bitmaps.
> > Any other ideas?
> >
> > On Mon, 06 Mar 2006 17:36:46 -0300, Adrian Park <[EMAIL PROTECTED]>
> wrote:
> >
> >> Hey Marcelo,
> >>
> >> I've been playing with BitmapData for the first time this past weekend
> >> so I
> >> stand to be corrected on what I'm about to say!
> >>
> >> My understanding is that you can only load BitmapData from an existing
> >> image
> >> which is already in your library and has a linkage ID. For this reason,
> >> I
> >> don't think you can load an image and get its BitmapData. I was
> thinking
> >> there might be a workaround though...
> >>
> >> I was going to try embedding the jpg/png/gif in an swf and giving it a
> >> linkage id in the library, then load that swf into your master movie
> and
> >> attach the BitmapData from the loaded swf's library.
> >>
> >> Possible issues? I know you can't attach library assets from a loaded
> >> swf
> >> into another swf so the same limitation may apply with BitmapData.
> >> Again, I
> >> thought a workaround for this might be to attach the BitmapData into
> the
> >> swf
> >> you've just loaded and then clone it to a BitmapData object elsewhere?
> >>
> >> As you can see, I've been doing a lot of thinking and not a lot of
> doing
> >> so
> >> I'm not sure if this is of any help at all!
> >>
> >> I'd be very interested to know if any of this works.
> >>
> >> Cheers, Adrian P
> >>
> >> On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:
> >>>
> >>> Hi list!,
> >>>
> >>> It´s possible to load an external bitmap (jpg, png, gif) into a
> >>> bitmapData?
> >>>
> >>> Or..
> >>>
> >>> It´s possible to load an external bitmap into an MC and then render
> >>> that
> >>> mc into a bitmapData?
> >>>
> >>> All what i tried didn´t work...
> >>>
> >>> Thanks in advance!,
> >>>
> >>>
> >>> --
> >>> _
> >>> Marcelo Volmaro
> >>> ___
> >>

Re: [Flashcoders] Load external bitmap into bitmapdata?

2006-03-06 Thread Marcelo Volmaro

Indeed, it works!,
Also, trying this i´ve found a method to attach loaded movies as  
bitmaps... now i can create libraries of MCs!!


Thanks!

On Mon, 06 Mar 2006 19:50:24 -0300, JesterXL <[EMAIL PROTECTED]>  
wrote:



I started to eat a cup, but it really didn't taste so good.  Suddenly, my
mouth really hurt trying to voraciously chew on ceramics, thus I gave up
upon realising cups don't taste so good.

...however, this code in fact works:

import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Matrix;
import flash.geom.ColorTransform;

function init()
{
 Stage.align = "TL";
 Stage.scaleMode = "noScale";

 createEmptyMovieClip("image_mc", 0);

 var mcl:MovieClipLoader = new MovieClipLoader();
 mcl.addListener(this);
 mcl.loadClip("test.jpg", image_mc);
}

function onLoadInit(target)
{
 var width:Number = image_mc._width;
 var height:Number = image_mc._height;
 var transparent:Boolean = false;
 var fillColor:Number = 0x;

 var myBitmapData:BitmapData = new BitmapData(width, height, transparent,
fillColor);
 myBitmapData.draw(image_mc, new Matrix(), new ColorTransform());

 createEmptyMovieClip("copy_mc", 1);
 copy_mc._x = 20;
 copy_mc._y = 20;
 copy_mc.attachBitmap(myBitmapData, 0);

 image_mc._alpha = 20;
}

init()

- Original Message -
From: "Marcelo Volmaro" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Monday, March 06, 2006 5:38 PM
Subject: Re: [Flashcoders] Load external bitmap into bitmapdata?


The problem is: I need to load a bitmap. I can´t embed the bitmap inside  
a

swf, because i have no control over the bitmaps.
Any other ideas?

On Mon, 06 Mar 2006 17:36:46 -0300, Adrian Park <[EMAIL PROTECTED]> wrote:


Hey Marcelo,

I've been playing with BitmapData for the first time this past weekend
so I
stand to be corrected on what I'm about to say!

My understanding is that you can only load BitmapData from an existing
image
which is already in your library and has a linkage ID. For this reason,  
I

don't think you can load an image and get its BitmapData. I was thinking
there might be a workaround though...

I was going to try embedding the jpg/png/gif in an swf and giving it a
linkage id in the library, then load that swf into your master movie and
attach the BitmapData from the loaded swf's library.

Possible issues? I know you can't attach library assets from a loaded  
swf

into another swf so the same limitation may apply with BitmapData.
Again, I
thought a workaround for this might be to attach the BitmapData into the
swf
you've just loaded and then clone it to a BitmapData object elsewhere?

As you can see, I've been doing a lot of thinking and not a lot of doing
so
I'm not sure if this is of any help at all!

I'd be very interested to know if any of this works.

Cheers, Adrian P

On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:


Hi list!,

It´s possible to load an external bitmap (jpg, png, gif) into a
bitmapData?

Or..

It´s possible to load an external bitmap into an MC and then render  
that

mc into a bitmapData?

All what i tried didn´t work...

Thanks in advance!,


--
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com








--
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Load external bitmap into bitmapdata?

2006-03-06 Thread JesterXL
I started to eat a cup, but it really didn't taste so good.  Suddenly, my 
mouth really hurt trying to voraciously chew on ceramics, thus I gave up 
upon realising cups don't taste so good.

...however, this code in fact works:

import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Matrix;
import flash.geom.ColorTransform;

function init()
{
 Stage.align = "TL";
 Stage.scaleMode = "noScale";

 createEmptyMovieClip("image_mc", 0);

 var mcl:MovieClipLoader = new MovieClipLoader();
 mcl.addListener(this);
 mcl.loadClip("test.jpg", image_mc);
}

function onLoadInit(target)
{
 var width:Number = image_mc._width;
 var height:Number = image_mc._height;
 var transparent:Boolean = false;
 var fillColor:Number = 0x;

 var myBitmapData:BitmapData = new BitmapData(width, height, transparent, 
fillColor);
 myBitmapData.draw(image_mc, new Matrix(), new ColorTransform());

 createEmptyMovieClip("copy_mc", 1);
 copy_mc._x = 20;
 copy_mc._y = 20;
 copy_mc.attachBitmap(myBitmapData, 0);

 image_mc._alpha = 20;
}

init()

- Original Message - 
From: "Marcelo Volmaro" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Monday, March 06, 2006 5:38 PM
Subject: Re: [Flashcoders] Load external bitmap into bitmapdata?


The problem is: I need to load a bitmap. I can´t embed the bitmap inside a
swf, because i have no control over the bitmaps.
Any other ideas?

On Mon, 06 Mar 2006 17:36:46 -0300, Adrian Park <[EMAIL PROTECTED]> wrote:

> Hey Marcelo,
>
> I've been playing with BitmapData for the first time this past weekend
> so I
> stand to be corrected on what I'm about to say!
>
> My understanding is that you can only load BitmapData from an existing
> image
> which is already in your library and has a linkage ID. For this reason, I
> don't think you can load an image and get its BitmapData. I was thinking
> there might be a workaround though...
>
> I was going to try embedding the jpg/png/gif in an swf and giving it a
> linkage id in the library, then load that swf into your master movie and
> attach the BitmapData from the loaded swf's library.
>
> Possible issues? I know you can't attach library assets from a loaded swf
> into another swf so the same limitation may apply with BitmapData.
> Again, I
> thought a workaround for this might be to attach the BitmapData into the
> swf
> you've just loaded and then clone it to a BitmapData object elsewhere?
>
> As you can see, I've been doing a lot of thinking and not a lot of doing
> so
> I'm not sure if this is of any help at all!
>
> I'd be very interested to know if any of this works.
>
> Cheers, Adrian P
>
> On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:
>>
>> Hi list!,
>>
>> It´s possible to load an external bitmap (jpg, png, gif) into a
>> bitmapData?
>>
>> Or..
>>
>> It´s possible to load an external bitmap into an MC and then render that
>> mc into a bitmapData?
>>
>> All what i tried didn´t work...
>>
>> Thanks in advance!,
>>
>>
>> --
>> _
>> Marcelo Volmaro
>> ___
>> Flashcoders@chattyfig.figleaf.com
>> To change your subscription options or search the archive:
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>> Brought to you by Fig Leaf Software
>> Premier Authorized Adobe Consulting and Training
>> http://www.figleaf.com
>> http://training.figleaf.com
>>
> ___
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com



-- 
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com 

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Load external bitmap into bitmapdata?

2006-03-06 Thread Marcelo Volmaro
The problem is: I need to load a bitmap. I can´t embed the bitmap inside a  
swf, because i have no control over the bitmaps.

Any other ideas?

On Mon, 06 Mar 2006 17:36:46 -0300, Adrian Park <[EMAIL PROTECTED]> wrote:


Hey Marcelo,

I've been playing with BitmapData for the first time this past weekend  
so I

stand to be corrected on what I'm about to say!

My understanding is that you can only load BitmapData from an existing  
image

which is already in your library and has a linkage ID. For this reason, I
don't think you can load an image and get its BitmapData. I was thinking
there might be a workaround though...

I was going to try embedding the jpg/png/gif in an swf and giving it a
linkage id in the library, then load that swf into your master movie and
attach the BitmapData from the loaded swf's library.

Possible issues? I know you can't attach library assets from a loaded swf
into another swf so the same limitation may apply with BitmapData.  
Again, I
thought a workaround for this might be to attach the BitmapData into the  
swf

you've just loaded and then clone it to a BitmapData object elsewhere?

As you can see, I've been doing a lot of thinking and not a lot of doing  
so

I'm not sure if this is of any help at all!

I'd be very interested to know if any of this works.

Cheers, Adrian P

On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:


Hi list!,

It´s possible to load an external bitmap (jpg, png, gif) into a
bitmapData?

Or..

It´s possible to load an external bitmap into an MC and then render that
mc into a bitmapData?

All what i tried didn´t work...

Thanks in advance!,


--
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Load external bitmap into bitmapdata?

2006-03-06 Thread Adrian Park
Hey Marcelo,

I've been playing with BitmapData for the first time this past weekend so I
stand to be corrected on what I'm about to say!

My understanding is that you can only load BitmapData from an existing image
which is already in your library and has a linkage ID. For this reason, I
don't think you can load an image and get its BitmapData. I was thinking
there might be a workaround though...

I was going to try embedding the jpg/png/gif in an swf and giving it a
linkage id in the library, then load that swf into your master movie and
attach the BitmapData from the loaded swf's library.

Possible issues? I know you can't attach library assets from a loaded swf
into another swf so the same limitation may apply with BitmapData. Again, I
thought a workaround for this might be to attach the BitmapData into the swf
you've just loaded and then clone it to a BitmapData object elsewhere?

As you can see, I've been doing a lot of thinking and not a lot of doing so
I'm not sure if this is of any help at all!

I'd be very interested to know if any of this works.

Cheers, Adrian P

On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:
>
> Hi list!,
>
> It´s possible to load an external bitmap (jpg, png, gif) into a
> bitmapData?
>
> Or..
>
> It´s possible to load an external bitmap into an MC and then render that
> mc into a bitmapData?
>
> All what i tried didn´t work...
>
> Thanks in advance!,
>
>
> --
> _
> Marcelo Volmaro
> ___
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Load external bitmap into bitmapdata?

2006-03-06 Thread Marcelo Volmaro

Hi list!,

It´s possible to load an external bitmap (jpg, png, gif) into a bitmapData?

Or..

It´s possible to load an external bitmap into an MC and then render that  
mc into a bitmapData?


All what i tried didn´t work...

Thanks in advance!,


--
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com