Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading external PNGs into flash 2

Status
Not open for further replies.

AlphaSunny

Technical User
Jul 13, 2004
11
CA
I have previously worked on a flash site that needed to display an external stock chart (auto-updated daily) on the Investor Relations section. The chart was originally developed in PNG format which is a lot smaller in file size and crispier than if done in JPG format ( vs While it was easy to load the JPG into my flash movie, I was unable to load the PNG which of course is my preference.

Any ideas on whether Flash supports loading external pngs? Thanks in advance,

AlphaSunny
Web Designer
AlphaTrade.com
 
Sorry, I forgot to say I was using Flash MX 2004 Professional. Also I searched the Macromedia site and Flash Help and the Internet and got no anwsers on the issue.

AlphaSunny
 
Don't think you can dynamically load .pngs. Couldn't you import it in a seperate external .swf, and dynamically load that .swf instead?
 
Thanks oldnewbie for the post, but I am sorry I still don't get the point.

The stock chart is generated/updated daily after markets close. What do you mean import the png in a seperate swf file then dynamically load the swf?

Here is what I just tried: in a new flash document I created an empty movie clip as a container and named the instance as Con, in the 1st frame I simply write

Con.loadMovie("
when published I saw nothing, but if I used this line instead

Con.loadMovie("
it worked. Both jpg and png images exist. I also tried loading png from an 'images' folder next to where this trial file is, the result is the same. I just wonder why Flash doesn't support loading PNG (or GIF) from external source. Or is there any way it can be loaded?

AlphaSunny
 
I assume the second loadMovie is a .JPG right?

JPEG's can be loaded at runtime. GIF's and PNG's aren't supported (as you've discovered). There is no way (that I know of) around it.

OldNewbie may have some tricks for this, but I'd say if you don't have control of the graphic file format you are in trouble.

Sorry for the bad news.


Wow JT that almost looked like you knew what you were doing!
 
Yeah the 2nd loadMovie is a jpg, sorry for the mis-paste.

Thanks a lot pixl8r, though it is bad news, you confirm that png is not supported, so I don't have to spend more time trying. Is there any supporting document/article from macromedia or elsewhere about this? (so I can convince our team in a better way)

Anyone else may have any other tricks?

Anyways, thank you pixl8r.

AlphaSunny
 
Don't think you can dynamically load .pngs.

Was I saying something fundamentally different than pixl8r?
 
If you still need it supporting documentation can be found in the Flash Help system under "Loading External SWF and JPEG Files".

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top