Hi Chris,
I was going to reply to this on the other
list, but her it is here. I like you guys better anyway ;-)
I agree with Tim. The MovieClipLoader
class is perfect for this situation.
The only downside is that it’s Flash 7 and up only.
Anyway, I was going to suggest that you
look at the class that Colin Moock has in his book
Essential ActionScript. He has a ImageViewer class that uses the MovieClipLoader
to load in JPEGs it’s a good example and a great starting point for what
you are trying to do.
You can find the code here:
http://moock.org/eas2/examples/eas2_imageviewer_take3.zip
I hope that helps.
-Chris
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Tim Beynart
Sent: Tuesday, August 16, 2005
7:24 PM
To: Open Source Flash Mailing List
Subject: RE: [osflash] Creating a
JPEG viewing component
create an empty movie
clip and use the MovieClipLoader class. forget the Loader component and
loadMovie, they suck.
You can manipulate your
incoming file easily using listeners to the MCL class, check out the help
files.
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of The Chris Method
Sent: Tuesday, August 16, 2005
5:45 PM
To: Open Source Flash Mailing List
Subject: [osflash] Creating a JPEG
viewing component
I posted this to
the FlashCoders list, but maybe it's more of an osflash type of question.
I'm creating a little swf that will take in the path to a jpg and display
it. All it really has to do is be able to zoom in and out and move the
jpg around. I'm using the open source FAME approach for the most
part. I had it working in the Flash IDE but am trying to get it to work in
FAME stuff.
My question is more about the structure of this flash movie I'm making.
My first version had five buttons: zoomIn, zoomOut, drag, update, and
reset. It had two textboxes, one that displayed the scaling factor and
one that displayed the path to the jpeg. It worked fine. I used a
MovieClip that had a Loader inside of it for the JPEG. The main reason
that I used the Loader was because it just seemed easier to me at the time,
although I'm wondering now if it would be overkill.
So what's the best way to structure this? Should I even bother with the
Loader component or should I just use a MovieClip and loadMovie() to load the
JPEG? I've been trying the latter approach, but I can't seem to drag
around my JPEG anymore. I don't know if it's becaue the MovieClip wasn't
scaled properly or what. Any help would be... uh, helpful.
Thanks,
chris