Copy link to clipboard
Copied
Does anyone has the source file for exporting jpeg from a movie clip that is actually working?
the movie clip is just a still image with 2 or 3 layers in it, it's not even mobile.
source file that I can look at the sample that is working would be Great!
Thank you
i saved the fla for cs3.
you can dl the source files at: http://www.kglad.com/Files/forums/jpeg/jpegCreate.rar
Copy link to clipboard
Copied
download mario klingemann's bitmapexporter from the link here: http://www.quasimondo.com/archives/000572.php
Copy link to clipboard
Copied
hi, thank you for the quasimondo link,
I tried the demo but it give me onSave dialgue failed to open.
I actually tried the other demos from the site, all of them seem have that problem
Copy link to clipboard
Copied
ok, I found this
can someone tell me what I suppose to do under Edit>Preference? I got lost there.
Does it work?
I gor error message: 1061: Call to a possibly undefined method save through a reference with static type flash.net:FileReference.
I tried to add > import flash.net.FileReference; ; I thought I might need this for calling FileReference, it still the same thing
Copy link to clipboard
Copied
that's actionscript 3.0.
are you using as2 or as3?
Copy link to clipboard
Copied
3.0, but then I'm with CS3..
does it work with you?
what i get lost on is this line "..
you will need the JPGEncoder file which you can get here: https://github.com/mikechambers/as3corelib. To use the source file, select Edit->Preferences->Actionscript->Actionscript 3.0 Settings . . . and add the folder where you put “mikechambers-as3corelib-release.93-8-g24c6c16\mikechambers-as3corelib-24c6c16\src” to the src paths. Then you should be able to compile and execute the Actionscript code.."
i don't understand how to add the src path
Copy link to clipboard
Copied
this works for me: http://www.kglad.com/Files/forums/jpeg/jpegTest.html
Copy link to clipboard
Copied
can you post your source file please??? I do really need to know this also what version of flash you on?
Thankyou
Copy link to clipboard
Copied
i saved the fla for cs3.
you can dl the source files at: http://www.kglad.com/Files/forums/jpeg/jpegCreate.rar
Copy link to clipboard
Copied
i think my life just got saved by this, so thanks a lot , going to try it out now
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
hi, kglad
so I made this out from your code, it gave me undefined jpegDat. Does jpgDatGenerate(mc) actually pass 'mc' clip to the function I wonder? any idea
jpgDatGenerate(mc);
function jpgDatGenerate (target) {
var bmpd:BitmapData=new BitmapData(target.width,target.height);
bmpd.draw(target);
var jpegEnc:JPEGEncoder = new JPEGEncoder(75);
var jpegDat:ByteArray = jpegEnc.encode(bmpd);
}
Copy link to clipboard
Copied
yes, if mc exists.
Copy link to clipboard
Copied
hi kglad
it debuged jpegDat undefined, may be its because jpegDat is defined inside function? in your original script, jpegDat defined in the main body and that works fine
Copy link to clipboard
Copied
where's your trace()?
Copy link to clipboard
Copied
hi kglad
my function jpgDatGenerate seem to door closed on the others, I tried create a few new var in it, they all not recognized in localSave();
may be there something I could do to make those var created in my function become globalized somehow?
Copy link to clipboard
Copied
trace().. hmm going to research that now
Copy link to clipboard
Copied
if you're seeing an error message copy and paste if after click file>publish settings and ticking "permit debugging".
Copy link to clipboard
Copied
I added var jpegDat:ByteArray; outside the function, it debug , but it doesnt create the jpeg..
Copy link to clipboard
Copied
I did what you said, it will generate the swf even when it debugged errors.
uploaded to server, cannot generate the jpeg
jpgDatGenerate(mc);
function jpgDatGenerate (target) {
var bmpd:BitmapData=new BitmapData(target.width,target.height);
bmpd.draw(target);
var jpegEnc:JPEGEncoder = new JPEGEncoder(75);
var jpegDat:ByteArray = jpegEnc.encode(bmpd);
}
something must be not right in this function
Copy link to clipboard
Copied
this is the error:
1120: Access of undefined property jpegDat.
Copy link to clipboard
Copied
may be i should pack the function into .as and make it a public?...
Copy link to clipboard
Copied
copy and paste the output from the following AFTER: clicking file>publish settings and ticking "permit debugging".
jpgDatGenerate(mc);
function jpgDatGenerate (target) {
var bmpd:BitmapData=new BitmapData(target.width,target.height);
bmpd.draw(target);
var jpegEnc:JPEGEncoder = new JPEGEncoder(75);
trace(jpegEnc);
var jpegDat:ByteArray = jpegEnc.encode(bmpd);
trace(jpegDat)
}
Copy link to clipboard
Copied
hi Kglad,
I put the trace codes in there, checked "permit debugging" under file>publish settings,
then go control>test movie.
the 'control' broad shows nothing, just blank.. (btw you missed ';' next to trace(jpegDat), i added that one, made no difference)
error report shows "1120: Access of undefined property jpegDat.".
Copy link to clipboard
Copied
on additional note, I added trace("hello world"); outside the function just on the second line,
crtl-enter, still blank in the output! I did allow the 'permit debugging'!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now