Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 9th, 2003, 10:22 PM
msteudel msteudel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 445 msteudel User rank is Private First Class (20 - 50 Reputation Level)msteudel User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 15 h 54 m 16 sec
Reputation Power: 6
loading jpg

I'm trying to load a jpg into a movie clip that I have in my frame. I know that you can't resize the picture until its been loaded so I tried to use the following code:

picholder_mc.onLoad = function(){
this._height *= 250/this._height;
this._width *= 250/this._height;

}
picholder_mc.loadmovie("room.jpg");

It seems that the onLoad function doesn't work for loading jpg's. So I can't figure out how I'll know when the picture is loaded.

Any ideas?

Thanks.

Reply With Quote
  #2  
Old March 10th, 2003, 11:54 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
hey,

what you'll have to do is cue an onEnterFrame event once you start loading, doing a test on the getBytesLoaded... once the getBytesLoaded() is greater than the getBytesTotal() for your instance, resize and kill the onEnterFrame event... it seems to be the only work around... let me know if you need code

cheers,

bret

Reply With Quote
  #3  
Old March 10th, 2003, 02:56 PM
msteudel msteudel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 445 msteudel User rank is Private First Class (20 - 50 Reputation Level)msteudel User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 15 h 54 m 16 sec
Reputation Power: 6
I thought I understood, but my code isn't working. Here's what I have:

picholder_mc.onEnterFrame = function(){
trace("here");
}
picholder_mc.loadmovie("Waterlilies.jpg");


I thought this would trace "here" over and over again, but its not tracing anything.

thanks bret.

Reply With Quote
  #4  
Old March 10th, 2003, 03:42 PM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
hmmm... well here's a work around... same concept, just a little different application.

cheers,

bret
Attached Files
File Type: zip resize.zip (359.0 KB, 563 views)

Reply With Quote
  #5  
Old March 10th, 2003, 11:30 PM
msteudel msteudel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 445 msteudel User rank is Private First Class (20 - 50 Reputation Level)msteudel User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 15 h 54 m 16 sec
Reputation Power: 6
Thanks Bret. I'm still not sure why my version didn't work, but yours did. Here's what I have:

************
_root.createEmptyMovieClip("placeholder_mc",1);
placeholder_mc.createEmptyMovieClip("pic_mc", 2);
placeholder_mc.pic_mc.loadMovie("girl51.jpg");
placeholder_mc.onEnterFrame = resize;
*******

That works fine. Now I'm trying to display files whose names are loaded from a SQL database. It seems like this code should work, but it doesn't:

***************
var data = new loadvars();
data.onload = function(){
current = 0;
if(this.n > 0){
_root.createEmptyMovieClip("placeholder_mc",1);
_root.placeholder_mc.createEmptyMovieClip("pic_mc", 2);
_root.placeholder_mc.pic_mc.loadMovie("images/"+this.filename0);
_root.placeholder_mc.onEnterFrame = resize;
author_txt.text = "images/"+this.filename0;

}
}
data.load("display.php");
*****************

Now its not resizing the photo. Its not recognizing the onEnterFrame call. Any more ideas?

thanks.

Reply With Quote
  #6  
Old March 11th, 2003, 09:44 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
so do you mean that it's not even calling the onEnterFrame function at all? (have you tried tracing something in that function to see if it's getting called...) Does the pic load in but not resize? Are you sure that all of your variables from your php script are loading correctly?

here's a thread concerning your exact same issue.. the second to last post has a solution if you cant get this version working (it's the same concept, just uses setInterval instead of an enterFrame event.)

http://friendsofed.infopop.net/2/Op...65&m=2263091586

cheers,

bret

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > loading jpg


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway