7 Replies Latest reply on Oct 13, 2006 6:46 AM by Newsgroup_User

    Saving Files

    Kirk Christopher
      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?
        • 2. Re: Saving Files
          Kirk Christopher Level 1
          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?
          • 3. Re: Saving Files
            Level 7
            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
            -------------------------------


            • 4. Re: Saving Files
              Kirk Christopher Level 1
              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.
              • 5. Re: Saving Files
                Level 7
                > 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?

                Which versions of Flash and Director?

                > Also, if I decided to go another way which shell would you recommend

                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
                -------------------------------




                • 6. Re: Saving Files
                  Kirk Christopher Level 1
                  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.

                  • 7. Re: Saving Files
                    Level 7
                    > I create my .swf and then pull it into a Director projector. What is
                    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

                    > 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.

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

                    > Do any of these solutions allow for the capturing of images off of the
                    flash
                    > stage?

                    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
                    -------------------------------