Groups | Blog | Home
all groups > flash actionscript > october 2006 >

flash actionscript : Saving Files


Kirk Christopher
10/11/2006 8:39:04 PM
I have a client who wants to create an application (on CD) where the user would
design there own layout with pictures and text. Then save a graphic capture of
it to their hard drive.

Can a flash projector save graphic files? Can it save the current frame to a
jpeg or other graphic format? Can anyone show me how to program something like
this?
LSNsaltlamp
10/11/2006 8:40:41 PM
Check out:
Kirk Christopher
10/11/2006 8:50:29 PM
Yes, that is very close to what I want to do. Except that it involves php.
The projector will be distributed on CD, so I can't use server side programming
to accomplish this.

Does any one else have a suggestion?
Peter Blumenthal
10/12/2006 1:43:38 PM
Sure - you need to create a shell for your flash app. You can use Director,
or one of the numerous pre-built shells around (i.e. Zinc, mProjector, HaXe
etc etc)(

--
-------------------------------
Remove '_spamkiller_' to mail
-------------------------------

Kirk Christopher
10/12/2006 1:49:19 PM
That sounds right. I own and have done many projects with Director. I am a
little rusty though. What do I need to do to implement this in Director? Say
I create my .swf and then pull it into a Director projector. What is next?

Also, if I decided to go another way which shell would you recommend. I have
looked up the ones you have suggested and am leaning toward Zinc.
Kirk Christopher
10/12/2006 6:42:08 PM
I have mx 2004 pro versions of each application, but I have hit another snag.
My client needs the final graphic to be print resolution (at least 300dpi.) I
have tested Zinc and all it seems to do is screen capture at screen resolution.
What I would ideally want to do is have a much larger version of my interface
hidden offstage and choose those pixels to save to my bitmap or jpeg file.

Do any of these solutions allow for the capturing of images off of the flash
stage? Zinc does not seem to be able to do this. Is there a better solution to
get an image from flash at 300 dpi? Will director be able to accomplish this?

I appreciate all of your input so far.


Peter Blumenthal
10/12/2006 6:45:13 PM
[quoted text, click to view]
next?

Which versions of Flash and Director?

[quoted text, click to view]

Hmm - I've had some bad experiences with Zinc lately - tends towards
bugginess. mProjector is supposed to be very good, stable and integrate well
with Flash's API. HaXe sounds really interesting too - used to be
Screenweaver, but is now open source (and free)!




--
-------------------------------
Remove '_spamkiller_' to mail
-------------------------------



Peter Blumenthal
10/13/2006 2:46:34 PM
[quoted text, click to view]
next?

The best way I have found of integrating Flash and Director communication is
via Director's setCallback. You create an empty function in your Flash movie
which can then act as a hook into Director. This function can accept as many
parameters as necessary, making this much more flexible than the
getURL("lingo:whatever"); approach.

So, in Flash

function fPassToDirector (sMyString:String, nMyNumber:Number,
bMyBoolean:Boolean) : String{
// 'Hook' function
trace ("if hook is functional, you will never see this trace");
}

var sDirectorResponse:String = fPassToDirector ("this is my string", 7,
true);

In Director, on your Flash sprite:


on beginSprite me
pSprite = the currentSpriteNum
pMember = sprite(pSprite).member.name
mySprite = sprite pSprite
myMember = member pMember

-- Create reference to Flash object
-- Note - you can hook into a class using "_level0.MyClassRef"
me.myFlashObject = getVariable(mySprite,"_level0",False)

-- Assign callbacks

mySprite.setCallback(me.myFlashObject, "fPassToDirector ",
#myDirectorMethod, me)
-- You can create multiple callbacks here
end

on myDirectorMethod me, pString, pNumber, pBoolean
return "My string is " & pString & " my number is " & pNumber & " my
Boolean is " &pBoolean
end


That's it! In Director, check documentation of

getVariable
setVariable
setCallback

[quoted text, click to view]
resolution.

Well, that makes sense - you can't screen capture at greater than screen res
:) Director will be the same.

[quoted text, click to view]

Director can certainly do this. No extensive experience of mProjector, but
when I used Screenweaver (HaXe predecessor) years ago, it could do screen
capture yes.





-------------------------------
Remove '_spamkiller_' to mail
-------------------------------

AddThis Social Bookmark Button