Resizing Movieclip

  • bjory
  • Born
  • Born
  • bjory
  • Posts: 3

Post 3+ Months Ago

I have a buttonMC which i created in the library and the swf connects to a database and depending on the database, it will display the number of buttonMCs on the stage one on top of another. The buttonMC itself has a dynamic text and a rect to hold the jpeg thumbnail externally as well.

What I did is to use the buttonMC on the library which has a dynamic
text on top and a rect MC called thumbHolder to hold the thumbnail.
And I created another rect on top of the thumbHolder called thumbNail and
i delete the shape so that it is an emptyMC.

I use this function to resize any jpeg loaded in the thumbNail MC:

Code: [ Select ]
CheckLoad = function()
{
if (this.thumbNail._width > 0 && this.thumbNail.getBytesLoaded() >=
this.thumbHolder.getBytesTotal())
{
this.thumbNail._width = 65;
this.thumbNail._height = 49;
delete this.onEnterFrame;
}
}
  1. CheckLoad = function()
  2. {
  3. if (this.thumbNail._width > 0 && this.thumbNail.getBytesLoaded() >=
  4. this.thumbHolder.getBytesTotal())
  5. {
  6. this.thumbNail._width = 65;
  7. this.thumbNail._height = 49;
  8. delete this.onEnterFrame;
  9. }
  10. }


And I used it as follows:
Code: [ Select ]
picFile = eval("recData.Image" + i);
_root["menuBtn" + i].thumbHolder.loadMovie(picFile);
_root["menuBtn" + i].thumbHolder.onEnterFrame = checkload;
  1. picFile = eval("recData.Image" + i);
  2. _root["menuBtn" + i].thumbHolder.loadMovie(picFile);
  3. _root["menuBtn" + i].thumbHolder.onEnterFrame = checkload;


It doesn't work thou.

I'm not sure how to create empty movieclips inside a button which
gonna duplicate depending on the database, so I had to manually create
it inside the buttonMC and delete the shape.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Quote:
this.thumbNail.getBytesLoaded() >= this.thumbHolder.getBytesTotal()

That might have somthing to do with it.
  • bjory
  • Born
  • Born
  • bjory
  • Posts: 3

Post 3+ Months Ago

Hi, thanks for the reply.

Anyway I can work around this or something? I'm not too sure how to fix it thou.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

As soon as _root["menuBtn" + i].thumbHolder.loadMovie(picFile);
is called your thumbNail clip ceases to exist. Loading directly into thumbHolder overwrites everything contained inside of thumbHolder.

A fix,
Code: [ Select ]
CheckLoad = function()
{
if ((this.thumbNail._width > 1) && (this.thumbNail.getBytesLoaded() >=
this.thumbNail.getBytesTotal()))
{
this.thumbNail._width = 65;
this.thumbNail._height = 49;
delete this.onEnterFrame;
}
}
  1. CheckLoad = function()
  2. {
  3. if ((this.thumbNail._width > 1) && (this.thumbNail.getBytesLoaded() >=
  4. this.thumbNail.getBytesTotal()))
  5. {
  6. this.thumbNail._width = 65;
  7. this.thumbNail._height = 49;
  8. delete this.onEnterFrame;
  9. }
  10. }

Quote:
picFile = recData["Image" + i];
_root["menuBtn" + i].thumbHolder.thumbNail.loadMovie(picFile);
_root["menuBtn" + i].thumbHolder.onEnterFrame = checkload;

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 16 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.