SitePoint Sponsor

User Tag List

Results 1 to 24 of 24
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flash: Importing jpegs

    hey there!

    i've got a question on flash 5:
    is there any possibility to import
    a jpeg-picture dynamically to a running
    movie?
    e.g. the filename of the picture is saved in an external textfile and can be changed by
    the user. the flash movie imports the textfile
    and loads the jpeg according to it.

    ahm....help?

  2. #2
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe that this feature is only available in the new Flash MX (Flash 6).

    However, having said that, it may be possible using Flash 5 in conjunction with a server side language. I cannot say for sure, as I have only skimmed the surface with Flash and ASP.

    But certainly it seems MX will make the need for Generator less and less.

    Glen

  3. #3
    ...
    Join Date
    Jan 2002
    Location
    London, UK
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    glenplake's right, This is a Flash 6 Player specific feature although you can export it from the Flash 5 editor...

    Code:
    loadMovie("TeriPolo.jpg", 1);

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In Flash 5 the one thing you can do is to use some sort of utility to convert jpegs into swfs, one is called jpg2swf and it runs from a unix command line. Having said that it may be possible to use a scripting language like PHP to create swfs out of the jpges you need to use, then you can load the swfs in using flash 5 and loadMovie(). Otherwise like said above you'll need generator to dynamically load images short of buying Flash mx.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    Non-Member Forlorn's Avatar
    Join Date
    Mar 2002
    Location
    San Diego, California
    Posts
    1,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea you can do it right from the import. Flash MX though has a better suport for it.

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Forlorn
    Yea you can do it right from the import. Flash MX though has a better suport for it.
    Not in flash 5, he is talking about loading in jpgs at runtime, something that cannot be done in Flash 5, you can load swfs in.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  7. #7
    Non-Member Forlorn's Avatar
    Join Date
    Mar 2002
    Location
    San Diego, California
    Posts
    1,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah ok. Are you sure it doesn't work with Flash 5. I think I did that one time and it worked for me.

  8. #8
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guarantee it, why in the world would they have needed generator if flash 5 could import jpgs at runtime? Think about it. Its one of the things that makes Flash MX that much better than Flash 5 and one of things that was able to aid Macromedia in phasing out Generator.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  9. #9
    ...
    Join Date
    Jan 2002
    Location
    London, UK
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There was no mention of Generator by the original poster, they simply suggested they needed to load the path to the images dynamically which can be achieved with the Flash 5 editor using Actionscript but as discussed above this will only work with the Flash 6 player.

  10. #10
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do a lot of things in Flash 5 that will only work in the Flash 6 player, but whats the point? I mentioned generator to illustrate why it was needed to get dynamic images into flash 5 at runtime? Get it?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  11. #11
    ...
    Join Date
    Jan 2002
    Location
    London, UK
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by freddydoesphp

    Not in flash 5, he is talking about loading in jpgs at runtime, something that cannot be done in Flash 5
    What was my point - simply that you can code loading in jpgs at runtime in 5 editor but no one with the 5 and under player with see it

  12. #12
    Pixel Junkie flux's Avatar
    Join Date
    Apr 2001
    Location
    Brussels Belgium
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this IS possible...there's a php that converts images to swf's on the fly=

    the only thing you need is to load the php as a movie into flash:

    Code:
    loadMovie("../php/wrapper.php?image=test.jpg", 1);

  13. #13
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Native support and using thrid party software are two different things. Don't forget the extra load on the server to make a erquest to a php script which in turn runs a program on the server, I assume jpg2swf. I say let's get them to upgrade to Flash 6 player
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  14. #14
    Pixel Junkie flux's Avatar
    Join Date
    Apr 2001
    Location
    Brussels Belgium
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so you consider an extra call to the server a bigger hassle for the user than downloading & installing a 400k plugin...

    btw... maybe it's not the point wether the user installs/doesn't install the plugin...but maybe creole doesn't want to invest another 200$ to upgrade Flash to MX.

    I won't be using Flash MX (for clients that is) for at least another 6 months / year (depending on the penetration of the plugin).

    I say let's stick to version 5 for a while

  15. #15
    Pixel Junkie flux's Avatar
    Join Date
    Apr 2001
    Location
    Brussels Belgium
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.sitepointforums.com/showt...=server+images

    more info about the php...

    This is not a PHP-module or add-on but simple PHP-functions you can include into your code.
    so no third party software involved, just some php functions...I tried it out and it works as a sweet.
    Last edited by flux; Aug 13, 2002 at 01:12.

  16. #16
    SitePoint Zealot flashswami's Avatar
    Join Date
    Jun 2002
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Worth pointing out maybe that prior to MX it is impossible to bring images into Flash. What the PHP script does is the same as Generator or Swift-Generator and that is to wrap the image up as a swf then perform a loadMove command on the new swf.

    Also maybe worth pointing out that Flash designers are not necessarily Flash developers and that therefore simply adding the line-

    loadMovie(blah.jpg);

    is a lot easier than adding a PHP wrapper function call and configuring PHP on a server.

    Might further be worth pointing out that not every Flash developer has access to PHP on their server.
    FlashSwami //Flash & server side fun
    DotDragNet //General web help
    [>Now available for freelance web work<]

  17. #17
    ...
    Join Date
    Jan 2002
    Location
    London, UK
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    loadMovie(blah.jpg);

    is a lot easier than adding a PHP wrapper function call and configuring PHP on a server.
    Hi flashswami,

    I prefer the idea of using flux's method -- your movie'll be compatable with the 3,4,5 and 6 Flash Player - which accounts for almost all people with the player installed.

  18. #18
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suppose we should keep using <font> tags also right, because some people's browser's don't support CSS. Come on people! Flash swami is correct, this is something that most flash designers will have a hard time implementing unless they know how to manage servers, or have someone willing to do it for them.

    You guys may want to keep supporting outdated flash players, I just don't see it that way. With those types of attitudes, noone will have to upgrade, why should they, as long as you keep putting out movies that they can view.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  19. #19
    SitePoint Zealot flashswami's Avatar
    Join Date
    Jun 2002
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Chas
    I prefer the idea of using flux's method -- your movie'll be compatable with the 3,4,5 and 6 Flash Player - which accounts for almost all people with the player installed.
    Point taken but although I would assume that most people on here are reasonably comfortable coding PHP this is not true of all Flash designers...a lot of new media people come from a trad media background and even something as simple (to us) as using a CGI wrapper would make them quake in their boots- I'd rather be able to to see a wide variety of designers and do version detection than see designers limited to an old coding standard.

    And lets be honest, the v6 player is far superior (well, it is now that they've released a stable version) to the v5 one in many more respects than dynamic loading of images- the accessibility add-ins are IMO worth asking browsers to upgrade for alone.

    IMHO, its short-sighted not to use new standards, as long as degradation is graceful, when the only obstacle is a 40 second download.
    FlashSwami //Flash & server side fun
    DotDragNet //General web help
    [>Now available for freelance web work<]

  20. #20
    ...
    Join Date
    Jan 2002
    Location
    London, UK
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could babble on about e-commerce sites not wanting to loss customers due to forcing them to download the latest player (why did boo.com go bust again?) and not forgetting all tho's that access the net from work who dont have permission to install new software - but what would be the point of that

    With this sort of problem in mind i'm trying out/building a Flash player version stats movie that uses php/SQL (could easily be adapted to work with ASP).

    Flashswami (or anyone else who wants to test it / help out) if your interested in running this on your site PM me.

  21. #21
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could babble on about e-commerce sites not wanting to loss customers due to forcing them to download the latest player (why did boo.com go bust again?) and not forgetting all tho's that access the net from work who dont have permission to install new software - but what would be the point of that
    That is just poor planning, especially for an e-commerce site, one would want the highest market penetration. To further that, Flash MX is only thing I would even consider using to do something like an e-commerce site, Flash 5 and below is just not made for this type of task.

    My point of course is that Flash MX is opening all sorts of new paths for us as developers (note I don't call myself a designer, just see my portfolio site in my sig and you'll understand why )

    AS a developer, I just love MX's new capabilities, so you will see me do nothing but talk about why we should use MX over 5. From a design standpoint, maybe it doesn'ty matter as mush. But as I am sure flashswami can attest to, Flash 5's xml support was poor at best.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  22. #22
    ...
    Join Date
    Jan 2002
    Location
    London, UK
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok with the new functionality added to MX (i spotted a simple one today - visitors can now copy and paste into input fields ) we should be using it to its full potential for sites.

  23. #23
    SitePoint Zealot flashswami's Avatar
    Join Date
    Jun 2002
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But as I am sure flashswami can attest to, Flash 5's xml support was poor at best.
    It was truly awful.
    FlashSwami //Flash & server side fun
    DotDragNet //General web help
    [>Now available for freelance web work<]

  24. #24
    Pixel Junkie flux's Avatar
    Join Date
    Apr 2001
    Location
    Brussels Belgium
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't get me wrong here, I love MX, and I can't wait to use it for other than personal projects...the thing is, I have experienced more than once that it's better to adapt to the user instead of vice versa. A couple of months ago, we developed a website for a company that makes artificial floors (www.venta.be). The contact of the company specifically asked to target the site to 1024*768...We warned him about the fact that some of the people would be left out. Two weeks after the launch they called us to redo the whole thing...one of the largest investors was on 800*600 and he was furious about the decision.

    Most of us (designers/developers) have quite new PC's, but there's a whole lotta internet users out there still surfing dialup on a 800/600 screen resolution with slooooowww processors. They aren't very keen on changing their monitors, because it makes their text and buttons much more difficult to read / icons to click.

    Downloading 400k on dialup imho takes a lot more than 40 seconds. I find it difficult to explain to a client, that, because of your choice of program e.g. 10% of potential visitors are being left out.

    Mx is better than flash 5, but considering everything together, I rather still use some workarounds than force the user to upgrade their system.

    At this moment less than 35% of web users have installed the v6 player. These are figures of MM, so probably the rates are even lower. http://www.macromedia.com/software/f...tml#appendixII

    About the XML: there's a very nice actionscript, freely available that fixes the XML parsing problems of the v5 player. Using this script (XMLnitro) XML is parsed more than 100* faster without giving you all the empty nodes that the original parsers gave you. http://chattyfig.figleaf.com


Bookmarks

Posting Permissions

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