A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: mx 2004 ? is there a way to write data to a file

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Posts
    126

    mx 2004 ? is there a way to write data to a file

    Hello.

    I have been waiting for the mx 2004 and now it´s available. Unfortunately I´m using Flash solely for multimedia and so I really hoped that the new Flash MX 2004 would improve support for multimedia CD releases.

    Wishlist..
    ( Right mouse button control )
    ( File IO )

    Using the new mx 2004...

    ...is there a way to read and write to a file ?

    Thanks.

  2. #2
    Flash Product Manager
    Join Date
    Mar 2002
    Posts
    140
    No. Flash runs in a security sandbox and does not have access to the local file system. You may want to check out Central (http://www.macromedia.com/software/central) as it supposedly has a few minor changes in the security model.

    Alternatively, you can use Director (http://www.macromedia.com/software/director) which is *arguably* the best multimedia authoring environment for fixed media development. With Director you can do things like this.

    Regards,
    MD

  3. #3
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    Local SharedObjects are gone in MX2004?!

    Geez, I hope not.

    http://www.macromedia.com/support/fl...s/local_so.htm

    *edit*

    Wait, no they can't be gone in MX2004. Nevermind. No more panic. Just use the tute on local shared objects and you'll be fine.
    Last edited by PAlexC; 09-24-2003 at 04:51 PM.
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  4. #4
    Flash Product Manager
    Join Date
    Mar 2002
    Posts
    140
    Well, OK, you're right. LSO's are *technically* writing to the HD. Though they still run w/in the sandbox. So if you're just looking to save text-based data (strings) to a user's machine, you can do so with local shared objects.

    Thanks for bringing that up, it completely slipped my mind.

    Here's a code example:
    Code:
    // Get the kookie
    so = sharedobject.getlocal("kookie");
    
    // Get the user of the kookie and go to the frame number saved for this user.
    if (so.data.user != undefined) {
      this.user = so.data.user;
      this.gotoAndStop(so.data.frame);
    }
    The following code block is placed on each SWF frame.
    Code:
    // On each frame, call the rememberme function to save the frame number.
    function rememberme() {
      so.data.frame=this._currentFrame;
      so.data.user="John";
    }

  5. #5
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    Text? Dude, you can store custom-defined objects in there without any conversion. LSO's are great!
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  6. #6
    Flash Product Manager
    Join Date
    Mar 2002
    Posts
    140
    Let me re-phrase:

    You can store variables in an LSO. So yes, that would include any instantiated objects and their associated data.

    LSOs are awesome. And if you have Flash Communication Server MX, you can store them on the server.

    ;-)

  7. #7
    Senior Member
    Join Date
    Oct 2002
    Posts
    126

    Sounds great but....

    how can I save the text file (cookie) inside the same folder the swf file is located in. Unfortunately I will be running a projector.exe located on the local computer in a specific folder. Can I save the file in the same folder ?

    thanks again for your quick reply.

  8. #8
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    LSO's will be created in the application data\macromedia\flash player\domain folder on the user's machine. (Under NT/2k/XP, this set of folders exists for each user. Flash uses the currently logged in user.)

    For CD-Roms, the domain will be localhost. Flash movies may only read/write out of their own domains for security reasons.

    However, within a domain, you can specify your own path if you don't want the files to be stored by swf name. (By default, flash makes a folder for each swf, based on the swf file name.)

    code:

    myso = SharedObject.getLocal("myfolder/mysofilename","/");



    This would create/read from a folder under the domain (in the case of a cd-rom, the localhost folder) named #myfolder, within there, there would now be a mysofilename.sol file which is your shared object.
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  9. #9
    Senior Member FPChris's Avatar
    Join Date
    May 2003
    Location
    NJ
    Posts
    644
    Hey Mike...

    Do you think MM will eventually add 'real' File IO
    for Text and Binary file writing? I think is would
    be unavoidable at some point in the future if they
    continue to push Flash for application development.

    There's the whole security issue but someother solution
    really needs to present itself. Shared Objects won't
    win over any seasoned application developers.

    Chris
    http://www.**********-dms.com

  10. #10
    Flash Product Manager
    Join Date
    Mar 2002
    Posts
    140
    Originally posted by FPChris
    Hey Mike...

    Do you think MM will eventually add 'real' File IO
    for Text and Binary file writing? I think is would
    be unavoidable at some point in the future if they
    continue to push Flash for application development.
    Yeah Chris, I agree with you. It seems inevitable that Macromedia will come up with some solution. However, as you can imagine, we are EXTREMELY cautious when it comes to security and the Flash Player. The second any conceivable security compromise is discovered the news spreads around the industry like wildfire. Fortunately our development teams have been publicly commended by the biggest Internet security agencies for how quickly they respond to security issues.

    My best guess is that local file system access will depend on some creative thinking on ways to avoid security problems. The same problem is being addressed with several web technologies. For now, check out Director as it has a lot more access to the local file system than Flash. Shockwave doesn't, but Director projectors do. Maybe that will be the answer for Flash in the future - something more along the lines of Director.

    I don't know, but I too will have to wait and see what our engineers come up with. For now, security is paramount, trust me. :-)

    MD

  11. #11
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    Originally posted by FPChris
    Hey Mike...

    Do you think MM will eventually add 'real' File IO
    for Text and Binary file writing? I think is would
    be unavoidable at some point in the future if they
    continue to push Flash for application development.

    There's the whole security issue but someother solution
    really needs to present itself. Shared Objects won't
    win over any seasoned application developers.

    Chris
    It's called Director. The only reason Flash gets all of the attention is that the Shockwave player has more overhead, and is less ubiquitous. Shockwave files are usually larger as well, and Director has a bit of a steeper learning curve.
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  12. #12
    Senior Member FPChris's Avatar
    Join Date
    May 2003
    Location
    NJ
    Posts
    644
    Originally posted by MikeDowney
    For now, check out Director as it has a lot more access to the local file system than Flash. Shockwave doesn't, but Director projectors do. Maybe that will be the answer for Flash in the future - something more along the lines of Director.
    Yep. Director is our current method for crossplatform
    with the getURL() to crosstalk with lingo.
    On the PC only projects I coded fscommands in C++ and
    embed the Flash as an ActiveX compoment.

    Both work but would love Flash to do it natively.

    From what you said it at least seems MM is aware of this
    and hopefully it won't be too much longer.

    Thanks,
    Chris
    http://www.**********-dms.com

  13. #13
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    I can see enhanced capabilities for Flash projectors similar to Director, or a special Director-based utility for making them, but the Flash OCX needs to stay light and secure, IMO, in order for it to stay popular.

    Flash and Director were never supposed to compete, remember? Director is really the tool of choice for hardcore CD-ROMs...even though I haven't looked at it since v7
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  14. #14
    Senior Member FPChris's Avatar
    Join Date
    May 2003
    Location
    NJ
    Posts
    644
    I think we can see Flash gaining on Director in each version.
    And we're all well aware of what Director can do.

    My comments were that if MM is promoting Flash for application development with form based design and an IDE etc.
    Then file IO then becomes unavoidable.

    What developer wants to make applications that can't read and write data?

    Chris
    http://www.**********-dms.com

  15. #15
    Flash Product Manager
    Join Date
    Mar 2002
    Posts
    140
    Originally posted by FPChris
    What developer wants to make applications that can't read and write data?
    Well, though I agree that file I/O would be nice to have, we need to think about what Flash is really for. It's not for creating "Applications" it's for creating "Web Applications" or, more specifically, "Rich Internet Applications."

    Reading and writing data with a web application is entirely different. Flash actually adds a new dimension to web applications with local shared objects - allowing you to store information on a web client's machine. More importantly, Flash integrates with application servers in many different ways.

    I think the comment that Director is for standalone, multimedia, fixed-media applications is right on. Though I can't disagree that Flash and Director have grown more similar release by release, they're still very different. Flash is aimed at web applications and Director is aimed at fixed media development. Both are superior to each other at their respective roles.

    MD

  16. #16
    Senior Member
    Join Date
    Oct 2002
    Posts
    126

    Further concerns

    Thank you for your answers. I´m currently working at a multimedia company and we are producing educational multimedia cd's for schools.

    Firstly I used Director to solve all projects. However because the people I am working with are graphic designers using Freehand to create all graphics for the projects I choose Flash. Firstly it´s much easier to import Freehand graphics into Flash, animation is fun and easy using separate timelines and everything looks smooth and great.

    What makes Flash a better multimedia tool in my situation is because its easy to animate and create animation effects and co-workers are using solely Freehand.

    I´ve tried to import Flash into Director. However its slow, doubles the work and it's clumsy.

    Maybe Macromedia could create a Flash version where special multimedia actions will be available only if the movie is running from an Executive projector. Just a thought.

    Thanks again

  17. #17
    Senior Member FPChris's Avatar
    Join Date
    May 2003
    Location
    NJ
    Posts
    644
    Hey Mike. Since MM is splitting Flash up these days.
    How about...

    "Flash MX2004 Professional AppDev CDROM Version 1.0 CDMX" ?

    Would make for a nice addition to the Flash family of products!

    Chris
    http://www.**********-dms.com

  18. #18
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    Originally posted by MikeDowney
    Well, though I agree that file I/O would be nice to have, we need to think about what Flash is really for. It's not for creating "Applications" it's for creating "Web Applications" or, more specifically, "Rich Internet Applications."
    Thank you!

    Flash is a COMPONENT of the MX platform which is competing with Java and .NET folks. (IMO, quite successfully.) NOT C++. LSO's are far better than cookies, which is all you have if you're using anything else on the web.

    Central is a GENIOUS component to this platform since it brings it, painlessly, to an Occasionally Connected Computing model. (Yes Mike, I'm gushing over it as an offline client for e-Learning to replace 187 MB run-time servers the client needs to install for their LMS. I just need an LMS vendor willing to give it a go.)

    That being said, Director is for CD's and DVD's, and frankly, it's a very good tool for it. If you want to write real applications to run on a CD, it's never going to happen with a tool as easy to use as Flash, however, Director comes pretty close.

    So again, Director just needs an update, or a Director-Lite that is designed around importing and using Flash assets for CD-ROMs and DVD's.
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  19. #19
    Junior Member
    Join Date
    Jul 2003
    Posts
    22
    Hi, i use flash for applications in some way:
    FDIV is a online gallery
    and FlaMP3 Is a mp3player, but with this it can be sooo much more (Using other technologies aswell as flash it could play everything! or the admin could browse select the chosen music and have the listner hear it on the admins site, and have a miniplaya in a title bar - u see!)
    And so can anything else.
    Like flash is sooo easy to use, you can create something fast and keep it looking good. But like i said flash has the potetional but its not getting used.
    I recently looked at this http://www.multidmedia.com/ and this company is seeing the potetional of flash, i still havent tried there products but im sure that they are making flash for applications.
    This once flash has these abllitys equiped inside it, it will be a remarkable step for flash. They will be replacing programming languages and many other things as the applications will be used for online purposes aswell.
    Blah Blah Blah Blah

    For the links for FlaMp3 and FDIV go here www.mf-index.tk
    Day Ja Vu
    ??Midi2Audio??

  20. #20
    Generous Newbie
    Join Date
    Apr 2002
    Location
    London, UK
    Posts
    147
    I don't know if this will help, but.....


    For CD-ROMs etc

    I have created a very flexible FlashPlayerTrust config files installer at

    http://www.armchair-travel.com/FlashTrustCD/

    Freeware Beta - Source Code Included
    Regards, William Donelson
    Explore the Taj Mahal, India - online VR tour - http://www.taj-mahal.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center