Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[MX] Maximum Clip Width?



Hi,
I am trying to build a site using the navigation style more commonly known as "Barney's menu", (where the pages glide in from the side). Here's what I have so far:

http://www.neilhillman.com/barneys.htm
(The first 4 tabs work).

Source: http://www.neilhillman.com/barneys.fla

... but have reached a problem. All my pages need to be in one long horizontal clip so as to scroll along, but Flash MX doesn't seem to like clips that are more than 3x the width of the stage, it won't allow me to scroll further to edit, and I keep getting invalid positioning errors!

I have heard that the solution is to create all your pages as seperate movieclips, and then use actionscript to combine them all into one long clip, but I was hoping someone can show me how to do this?

Thanks!



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-14-2007, 11:16 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Movie Clip -- Maximum Width?
I've created a movie clip that was 3500 pixels wide and worked fine. When I postition something past that using the properties bar to set x and y corrdinates it is there and appears in the final swf. But when I try to scroll movie clip fla past 3500 pxs it won't do so and the object is unclickable.

Obviously one can place objects beyond 3500 pxs but why won't the movie clip fla scroll there and let the object by manipulated?

Maximum Width Of Movie Clip?
So I'm having a little trouble with a project. I'm creating a portfolio that contains these very wide images that I have a little horizontal dragger for. I am having two problems with it.

Here is the file (I promise to leave this on the server as it is so that future people can also get help from this post): http://www.whosyourstudio.com/scroll/TCmoon1test.html

Problem #1: It doesn't load with the left edge of the image at the left edge of the document, as I have it set up in the flash file. I can't think of a reason for this to happen.

Problem #2: It doesn't scroll all the way across the image. It appears that the image is too wide for Flash to process. Is there such a thing? Here is the original image file: http://www.whosyourstudio.com/scroll/moon1.jpg

I have also posted the Flash file so you can poke around in it: http://www.whosyourstudio.com/scroll/TCmoon1test.fla

Sorry, I code the old way, so it's not all sitting on the frames. You will find the actionscript on the page by clicking on the main image, the little black line, and the draggable star. There is also some code on the button within the draggable star's movie clip .

Mcs Maximum Width
I have an mc of about 6000px width (it's a row of pictures) and flash display the animation with that mc in an ackward way. With a shorter version the swf works fine.
So can anyone tell me what are the limitations of size (max width and max height) of a mc so flash can handle it correctly?
Thx in advance.

Maximum Width Of Swf (resolution)
I have one of my old site here and I have trouble with horizontal scroller in resolution 1024*768 in IE 6.
The problem is only in IE 6, by Opera and Firefox is the horiz. scroller not displayed.
I canīt find solution.

What is the maximum witdh of swf in resolution 1024*768 to have browser without horizontal scroller?
Thanks

Maximum Stage Width
I built a video player w/ fullscreen mode. I just upgraded my moniter to a 30" and when I tested the video player my bg_mc did not scale the total width of the screen. I then checked youtube, revver, dailymotion, ect. All had the same behavior. I tried adding 1000 pixels to the Stage width and it had no affect.

Why is the max Stage.width smaller then consumer monitor resolutions?

What is the max width for a single mc?

When is this going to be corrected?

Maximum Width Of A Shape.
I'm in the process of fixing a site and I'm running into trouble with a shape. This shape acts as a background that scrolls. When I want to make the shape bigger than 2880 W, I get an error stating "Invalid size and position."

Is 2880 the maximum width you can make a shape in flash. I thought I'd made one bigger...

Thanks in advance for the help.

Jamie

Is There A Maximum Width And Height For A .swf?
I am trying to make one that is 2400 pixels wide and 1400 pixels high so that it will become a background for a website, but it seems to show up about 200 - 300 pixels short. It shows up with white strips on the left and right edges of a single screen, but it should cover a double screen set to 1280 by 1024.

Your help would be greatly appreciated, thanks so much!

Maximum Movie Width
I'm trying to create a fullscreen flash site in order to get around the maximum width limitation that flash has but alas it appears that a flash movie will still only stretch out to 2880px regardless of changing the published html to 100% width and height. Does anyone know a way of around the 2880px maximum width

Maximum Width Of Swf (resolution)
I have one of my old site and I have trouble with horizontal scroller in resolution 1024*768 in IE 6.
The problem is only in IE 6, by Opera and Firefox is the horiz. scroller not displayed.
I can?t find solution.

What is the maximum witdh of swf in resolution 1024*768 to have browser without horizontal scroller?
Thanks

Maximum Flash Canvas Width?
Is there a maximum flash canvas width? I'm doing this bkg scrolling timeline thing and all my date entries are 615 pixels wide in one movie. So each date entry is positioned in multiples of 615:

1993 - 0
1994 - 615
1995 - 1230
1996 - 1845
etc...

All was working great until my 1996 date - it doesn't show up.

What happens when you mouseover the main date nav is the bkg dates scroll either in or out, depending on which date you're hovering on.

Any Way To Override Maximum Stage Width?
I have a setup already set up in Flash where a number of images load left-to-right, based on data loaded from a plain text file. I then put the whole document into an i-frame.

The problem is the 2880 pixel limit to Flash's stage size - I sometimes have more images than will fit on the stage. Is there any way to override the maximum stage size limit?

Maximum Width Of Swf (resolution Problem)
I have one site here and I have trouble with horizontal scroller in resolution 1024*768 in IE 6.
The problem is only in IE 6, by Opera and Firefox is the horiz. scroller not displayed.
I canīt find solution.

What is the maximum witdh of swf in resolution 1024*768 to have browser without horizontal scroller?
Thanks

Expanding Movie To Maximum Width
Hi,

I have a small animation saved as a SWF file. The video was designed with a specific width and height, but can be resized to any size, as long as it keeps the width to height ratio.

I'm embedding the video within a div that fluidly expands to span across the entire width of the page. I would like the flash video to fill the entire horizontal width, and expand vertically to keep its ratio.

Therefore, if my video has a 4:1 width:height ratio (hypothetical), and the user expands their browser to 800px in width, I would like the swf to resize itself to 800x200px within the div, pushing down any elements below it.

Is this possible?

Thanks!

Internal Clip Width Bigger Than Movie Width?
i have a movie that is 750 pixels wide. i have a movieclip inside this main movie called "menuBack" that is just a bit less wide than the main movie. this movieclip has several other clips inside of it. i set a variable on a keyframe in my main movie getting the width property of "menuback". of course i expected it to be just a bit less wide than my main movie, maybe 720 pixels wide. when i test the movie and then check debug/list variables, it say it is 1095 pixels wide...how is this possible?

flash 5 btw...

Measure Width Of A Growing Clip Before The Clip Is Executed
Hello there,
need some help here, please please please

I've got a movieclip which contains a "tracer" that draws dinamically a stroke on the scene by running on a motion guide.
I'would like to be able to measure dinamically the width of this clip before it's executed so I can duplicate offsetted instances of the clip and make this bunch of paths look like a single long long path.

I've got a code that looks something like this:


Code:
for (i=0; i<=N; i++) {
draw the clips in the correct order bla bla bla
}
If I do a


Code:
trace(getProperty(_root.mc_disegna, _width));
before the for cycle i get growing values each frame like


Code:
4
15
28
31
and when the first clip is fully executed I get the real full size

if I trace the same thing after the for cycle I get the real size (36) but then I can't use this correct measure to offset the other instances because I would like to pre declare this size.

I've been trying with getBounds and getRect but had no luck

Movie Clip Width
I'm loading a .jpg file into an empty movie clip. When I get the height of the movie clip, it returns the correct value. When I get the width of the movie clip, it returns the value times ten. So if the jpg is 800 pixels wide, it returns 8000. Anyone know what could be causing this? Here's the code...

Frame 1 - Main Timeline:

Code:
firstLoad = true;

function loadImage() {
imageLoader.loadMovie("test3.jpg");
}

function moveImage(clipName) {
if(clipName._height > clipName._width) {
clipName._width = 100;
}
else {
clipName._width = 200;
}
}

loadImage();
And here's the actionscript on the empty movie clip:

Code:
onClipEvent(load) {
trace(_root.imageLoader._width);
if(!_root.firstLoad) {
_root.moveImage(this);
}

else {
_root.firstLoad = false;
}
}

Getting Movie Clip Width
OK, my turn for a question. Slightly deceptive title, but hey.

For my second creation in flash im going for something... well, just much better.

Im going to load external swf files externaly to reduce initial downloading times. And i've got me a cool border for them, which resizes itself based on the width of the movie and such, and expands and contracts on mouse over/out. Its all very nice.

But, rather than having these windows in static locations, i thought, what if they where randomly placed? So i did that, and it works. I of course need the width of the movie clip so i can make sure it doesn't go off the edge of the screen.
I'm currently putting the code into one easy to use function. But the problem occurs, that as soon as you call loadMovie() then ask for the width, you get 0.

I need to ask for the width on the next frame, but, with it being in a function, it can't really wait until the next frame, so what can i do?

Getting A Movie Clip's Width
I'm building a wallpaper photo gallery. There are clickable thumbnails across the bottom with a hand-made scrollbar system that slides the thumbs right and left.

The thumbnails are dynamically loaded from external URLs using the Movie Clip Loader API. I load them one at a time and position them nicely side by side. Let's say each thumb is 100 pixels wide and I'm not using any margins between them.

The problem is, I have a couple different sets of thumbnails. When one loads, it replaces the previous set. But when I load a set with 15 thumbnails, then load a set with 10 thumbnails, the width of the container movie clip that holds the thumbs REMAINS at the 15 thumb size. So say 15 thumbs are 1500px wide, and 10 thumbs are 1000px wide. I load the 15 thumb set, wait a second, then load the 10 thumb set, and my scrollbar still thinks the container is 1500px wide.

This isn't a problem with getting the new width. If I load the small set first, then the big set, it resizes correctly to fit everything. It's almost like there's an artifact of the larger set that's forcing the width.

Here's how I empty out the container clip before loading a new set:
// Clear out the previous images
for (myname in _root.wallpaperChooser.thumbs.thumbsContainer) {
removeMovieClip(_root.wallpaperChooser.thumbs.thum bsContainer[myname]);
}

That should clear out every single object inside thumbsContainer right?

I've tried setting the width to zero after doing that, but then the newly added clips don't seem to force the width to expand.

Is there anything I can do to force the movie clip to take on the width of its inner elements? Other than calculate the width of all the thumbnails and set it manually to that value (I've tried this but everything seems to get squashed, maybe because of the artifacts from the previous set)? Or is there anything I'm missing?

Thanks!

Movie Clip Width Constraints
hey all - i'm making a flash movie with a hella long image (which i'm building as a movie clip). i'm planning on using scrollbars built into the file to scroll it, so i don't want to make the movie any wider. however, its longer than the allowable build space in flashMX... suggestions???? the image can't reallly be broken up into links, its very important that it scroll...

thanks

Width Of Duplicated Movie Clip
Can anyone see why I can't get the width of the copied movie clip ??



Code:
duplicateMovieClip("char", "char" add i, i);
set("char" add i add "/letter:char", substring(text, i, 1));
//
thewidth=["char"+i]._width;
//
trace("thewidth="+thewidth);
Thanks

Gareth

Setting The Width Of Movie Clip
What I have is a movie clip with dynamic text field within
and what I wanna to happen is that when certain text is loaded inside that text field, the width of the movie clip is adjusted or setjust enough to show all the characters inside the text field!

Can it be done?

Check Width Of Movie Clip?
Hi guys, i have a health bar of 100pixels called mc, and a button. When the button is clicked, the health bar decreases by 10 pixels. However i want it to go to frame 2 if there is no health, and want the width to be constantly displayed in a text box. The code i have so far is:

on(release){
_root.mc._width=_root.mc._width-10;
}

Thanks alot, Dave.

Browser Width Movie Clip In As3?
Basically I want to make some flash which I am going to import into dreamweaver. The flash I am making needs to be as wide as the users screen. So basically i need to make my stage width the same as either screen resolution, or browser sizer, and then put my bar going full width of stage. What is the code for making the stage same width as screen?

Movie Clip WIDTH Undefined
I am having trouble with my AS for my image gallery component I am developing.

1. I am loading images (using a loop of the XML element) into a movie clip in frame 1.

2. I am then trying to trace the width of this movie clip in frame 2 (the reason I am doing this is because I remember someone saying something about the mc_width not being recognized until one frame later - even though other properties like _xscale work instantly).

3. I still get UNDEFINED in the debug window for the trace

WHY WHY WHY ?????

Hope someone can help.

Regards

Alex

Check Movie Clip Width?
Hi guys, i have a health bar of 100pixels called mc, and a button. When the button is clicked, the health bar decreases by 10 pixels. However i want it to go to frame 2 if there is no health, and want the width to be constantly displayed in a text box. The code i have so far is:

on(release){
_root.mc._width=_root.mc._width-10;
}

Thanks alot, Dave.

Determining Width Of Loaded Clip
Hi all,
Is there a way I can get and set the width and height of a loaded movie clip? I have created an empty movie, and then loaded a small swf file into the empty movie with loadClip. I now want to determine the width and height of this loaded clip, and scale it to the size of my movie dimensions. Can this be done? Although the movie loads fine, and I can position its x and y coordinates, the width and height show as zero.

Can anyone help me with this one? I'm using Flash Professional 8.

Thanks,
brayne





























Edited: 04/19/2007 at 09:31:58 PM by brrayne

Attachmovie Clip Width = 0, It Lies
Ok, I am attaching a movie, valled targetx it has a second clip inside it, called holder. I am using loadmovie to load an image or swf into the attachmovies holder clip. But, if I use trace(targetx.holder._width) to get the loaded clips width I get 0, which is cleary no correct. Why is this?

Movie Clip Changes Width At Runtime
I have a movie clip on the stage. When I click on it, the info bar shows its width is 90px. When I test the movie and do a trace( mc._width ) it has a width of 97.1 .... any clue how this could be happening?

Movie Clip Width 100% Centred
Morning everyone,

I'm having a problem with AS3...I want to have a movie clip that spans the width of the browser window which is centered so if the browser is scaled the content in the center remains the same size but the left and right expands.

In css it would be a little like adding margin:auto to a div tag.

Ideally it would be great to load in various external swf files for different sections that images txt etc are able to move in from the edge of the screen.

This sort of thing http://www.elmwood-design.com.au

Does anyone know of a tutorial or post that may shed some light on this. Still quite a green with AS3.

Cheers

Need To Get Width Of Empty Movie Clip
Hi~
I searched but didn't find a clear answer, maybe someone out there has done this before.

I'm using the CreateEmptyMovieClip to import jpegs(my portfolio images) into my flash movie. I know how to position the first image using _x and _y. How do I position the second image so that it's to the right of the first one + 20 pixels?

Here's what I have so far. Anyone have any ideas?

________

this.createEmptyMovieClip("item1_mc", 10);
item1_mc.loadMovie("http://sonic-cow.com/doran/journal_01_02/images/diary%20pix/resE_01.jpg");
setProperty(this.item1_mc, _y, 20);
setProperty(this.item1_mc, _x, 20);

this.createEmptyMovieClip("item2_mc", this.getNextHighestDepth());
item2_mc.loadMovie("http://sonic-cow.com/doran/journal_01_02/images/diary%20pix/resE_02.jpg");
setProperty(this.item2_mc, _y, 25);
setProperty(this.item2_mc, _x, (item1_mc._x+item1_mc._width));

_______

thx in advance!
Doran

Scaling Clip To Stage Width
ActionScript Code:
box._x = 0;
box._xscale = Stage.width;
trace(box._width);


when i test the above script, my movie clip doesnt scale to the the stages width. Any thoughts?

Setting Width And Height Of A Movie Clip
I want to dynamically load JPGs in to a movie; there are going to be 1000's of JPGs that vary in size. The JPG will load when the user selects which image to load and it will have a drop shadow (mc) that changes to the same dimensions as the loaded image, offset maybe 10 pixels.

I have started by creating an empty mc when the user clicks on a button. A JPG is then loaded into that mc. The drop shadow is a graphic symbol within an mc named 'shadow_mc'. This is initially set to not be visible, but becomes visible after loading the JPG. The code I am using is below:

----------------------------------------------------

on (press) {
_root.createEmptyMovieClip("holder", 1000);
holder.loadMovie("myPic.jpg");

_root.shadow_mc._visible = 1;

_root.holder._x = 10;
_root.holder._y = 10;

imageWidth = getProperty(_root.holder, _width);
imageHeight = getProperty(_root.holder, _height);

_root.shadow_mc._x = _root.holder._x + 10;
_root.shadow_mc._y = _root.holder._y + 10;

_root.shadow_mc._width = imageWidth;
_root.shadow_mc._height = imageHeight;
}

----------------------------------------------------

The problem comes when trying to set the properties of the 'shadow_mc'. Setting the x and y values is no problem and I can offset the mc that holds the drop shadow (+10). However when trying to match the drop shadow to the dimensions of the image I cannot get it to work.

First I tried:

_root.shadow_mc._width = _root.holder._width;
_root.shadow_mc._height = _root.holder._height;

but this did not work so I have used getProperty in the above code and assigned the results to variable names to try and set the shadow width and height to match, but still no luck. In fact when I use _width and _height the shadow cannot be seen at all.

Finally any other suggestions on how to approach this and I read that I should make sure the image is loaded before doing anything with it, how do I do that?

TIA,

Adrian.

How To Get Loaded Movie Clip Width And Height ?
How can i get loaded movie clip width and height ?

Movie Clip Width Limit? PLEASE HELP A Girl Out.
okay,

I have a MC that i am dropping on the main timeline.

The problem is that I am out of space on the MC.
I kept placing objects to the right and scrolling over, well now flash won't scroll over any more. It just cuts off and i can't even drop an object over any farther. I am making an actual "timeline" (not a flash timeline, but rather representing one graphically)
How do i get the movie clip width to increase?
How can i solve this problem another way?

I have tried increasing the width of the movie, but all that does is make the stage on the main timeline bigger, and does nothing to the width of my movie clip.

thanx for any help you can give me!

MX - Preloader Setting Width Of Mask Clip?
Let me see if I can explain this in a way that makes sense...

I'm using the stardard preloader that expands the width of the loader bar in relation to the percent loaded. However, I am trying something a little different and it's not working.

I have an image that's under a mask. I wanted to use the loader bar as the mask to slowly reveal the image below as it expands.... it's not working.

The problem is that it doesn't seem to be stretching the loader mask (movie clip that is targeted to stretch). I know my pathing and everything is ok because I can remove the clip from the mask and it stretches just fine as the movie loads.

My guess is that Flash can't target a clip (instance name) if it is used in a mask.

Is this right, or does anybody have any suggestions?

Changing Height And Width Of A Movie Clip
I have a movie clip called user_avatar. This movie clip is just a blank movie clip used to load an image into it.

Here is the code I am using to load the image into the movie clip: (the photo loads in correctly)
user_avatar.loadMovie("chris.jpg");

I tried putting this under the above code
user_avatar._width = 24;
user_avatar._height = 24;
When I added these two lines the photo didnt load in anymore

Also I tried putting this code on the movie clip (user_avatar)
this._width = 24;
this._height = 24;
When I added these the photo loaded in but it didnt get resized

I basically want to resize the photo loaded into the movie clip to be 24 pixels wide * 24 pixels height. Hopefully it is possible...

Any help would be appreciated!
Adam

Dynamic Movie Clip Width Limit?
i'm building a crawl along the bottom of a screen that pulls data from an array and adds it to a dynamic text box. after that text box is built, it calculates the width of the text box, moves another copy of it to width+20 and adds at the text into it also, so that when the crawl ends, the other one is there to keep it constantly on screen.

the problem i'm running into is: it seems to work when the clip is 4000-5000 px long, but when i get it up to 12 or 15000 px wide, it starts freaking out. is there a limit to the size i can go or what?

scott

Finding The Width/height Of A Movie Clip
When importing bitmaps/jpgs/pngs etc is there a way to find the height and width of that image before it loads. in the preloading stage?

basically i want my preloader to be a black box the size of the image to be loaded?

Cheers

Unable To Determine Clip Width After Its Loaded
Hi,

I am loading images into a container movie clip in response to user commands. As the images are fairly large I use a preloader. This preloader looks like this:


ActionScript Code:
var loader_mcl = new MovieClipLoader();
loader_mcl.addListener(this);


function startPreload(url){
    loader_mcl.loadClip(url, container_mc);
}

Using MovieClipLoader() allows me to use its methods to determine when the clip has loaded, where I place further commands to position the new clip relative to its width. However I am unable to determine the clips width, it simply returns 0.


ActionScript Code:
function onLoadInit (target){
   
    // remove the preloader animation
    preloader_mc.removeMovieClip();
   
    //set position of movieclip
    //target.setPos();
    _root.setPos(target);
    trace(target._width);
}

Can anyone tell me why I can't determine its width?

Thanks.

How To Determine Width Of Library Movie Clip
Hello,

Does anyone know if you can find out the width and height of a movieclip in the library (not an instance on the stage). I'm using the Window component and want a window to pop up at the correct size to accommodate the movieclip I'm loading from the library.

The only way I can see to do it is to create an empty movie clip on the stage (invisible), attach the movie clip from the library, get the width and height, and then use those figures to open the window. Is there an easier way?

With thanks,


Julia

Empty Movie Clip Width Problems
I'm trying to load images into a row of images. Each image is a different width. Heres the code so far:

ActionScript Code:
var xPos:Number = 0;for (y=0; y<5; y++) {        var container:MovieClip = this.holder.createEmptyMovieClip("picholder"+y,y);    container.loadMovie("mypic.jpg");    container._x = xPos;    xPos += container._width;}


The problem at the moment is that the container._width property is reading 0 so all the images are loading on top of each other. This is the same with "picholder"+y. If I set the xPos value to say 100 then it works fine. I'm guessing its something to do with the fact that the loadMovie happens after the var container is defined. Whats a way around this?

Any help much appreciated

Also just while I'm posting whats the correct syntax for something like this:
container.loadMovie("mypic" + (y) +".jpg");

Hide Movie Clip's Real Width
I have one main movie clip "content" that contains evreything for my site. A script running on _level0 watches the width/height of this movie clip to keep it centered within the flash window.

Now, I have masks inside this "content" movie clip. These masks may be quite small (say 400px wide) yet they are revealing only small areas of much larger jpegs (maybe 2000px wide).

My problem is that the script running to center the "content" movie clip measures these massive jpegs that are hidden by the mask. I would like only the revealed portions to be centered within my movie.

Any ideas?

Cheers, James.

Change Width Of Movie Clip When Button Is Clicked?
Hi guys, this one should be quite simple. Just want a bar (it's going to be a health bar) to decrease it's width by 10pixels when a button is clicked.

cheers, Dave

Dynamic Textbox Width - Positioning Movie Clip
Hi,

I have a dynamic text box which will display text of varying lengths. To the right of this I have a movie clip. I want to be able to set the x position of the movie clip as the x position where the text ends.

I assumed this would be easy:

_root.mc._x = _root.textBox._x + _root.textBox._width

The movie does move when I use this code but it doesn't move to the end of the text it positions itself within the bounds of the text box.

It looks like it is something to do with the textBox._width property but I am not sure what. Can anyone point me towards how to get the x position of the end of a text box? and also what exactly the textBox._width does.

Many Thanks

Finding The Width Of A JPEG Loaded Into A Movie Clip
I will be loading a page of bio information. Next to the person's photo (photos will vary in width) I want to put a column of buttons about 20 pixels to the right of the photo. So after I load the photo into an empty movie clip, I'm trying to get the width of the photo in order to figure out the x position of the buttons next to it. Here is what I have:

myImage = "images/" + _level0.images[link];
loadMovie(myImage,image_mc);
// JPEG loads okay into image_mc //

trace("image_mc._x = " + image_mc._x);
// I get "Image_mc._x = 393" as expected //

trace("myImage._width = " + myImage._width);
// I get "image_mc._width = undefined" //

trace("image_mc._width = " + image_mc._width);
// I get "image_mc._width = 0" //

How do I find the width of the loaded JPEG?

Movie Clip Positioning Based Off Textfield Width
I have a text field on the left and a movieclip butted up to the right of the text field. How can I move the movieclips position left or right based on the text fields width?

Thanks,
Saveth

Problems Changing Height/width Of A Movie Clip
I have been working on this problem for hours and am close to getting it working but am starting to get very frustrated because I just can't get it to work....

I am trying to load an image into a empty movieclip and then resize that movie clip!

You can download my test file here: http://www.trackie.ca/resize_mc.zip

Here is a description of the .fla and what I am trying to do:
Here is the code in the action layer


ActionScript Code:
//Load the JPG image into the movie clip
user_avatar.loadMovie("garfield.jpg");
 
//Gets the percentage loaded
avatar_percent = Math.floor(user_avatar.getBytesLoaded()/user_avatar.getBytesTotal()*100);
 
// Waits until the Movie is loaded before changing the properties
if (avatar_percent eq "100") {
user_avatar._width = 80;
user_avatar._height = 80;
user_avatar._x = 0;
user_avatar._y = 0;
}


The 2nd Layer (named: loadClip) contains a blank movie clip with an instance name of user_avatar which is where the garfield.jpg image gets loaded.

The final Layer (named: percentage) just holds a dynamic text box with the variable name avatar_percent which holds the percentage loaded.

the file loads in fine but when I attempt to change the _width and/or _height of the user_avatar movie the image disapears... When I change the _x and _y it works fine.

Note: The file attached works perfect but I imported the jpg image myself into the movieclip (You will notice the user_avatar movieclip is not blank but has the image imported). But I dont want to manually import an image I want to load it into the flash file.

I hope someone can help me with this as it is driving me crazy...
Thanks
Adam

Dynamically Sizing Clip To Stage Width+height
so i guess what the real question is is how would make the movieclip smart enough to know when its reached the top of the stage and bottom from different positions on the stage.

i have a button that is duplicated three times one after the other. so when they resize even though they are now equal to 600 in height (my stage is 800x600) they are not positoned isnt equal to the top and bottom of the stage.

here's my code as it stands now:

sW=Stage.width;
sH=Stage.height;

fillScreen= function (clip) {
speed = 4;
clip.onEnterFrame = function() {
this._height += (sH - this._height)/speed;
if(Math.round(this._height) >= sH){
this.onEnterFrame = null;
trace(this._name+" equals null");

} else {
trace("AAA" + _parent._name + "not equal to stage");
trace("BBB" + "sH value: " + sH);
trace("CCC" + "this._height equals: " + this._height);
}
};
};
i hope that makes sense
thanks for the help

erase

Loading JPG Dynamically Into Movie Clip--but Can't Find Height/width
I'm loading jpgs using this:

Code:
currentClip = createEmptyMovieClip(_global.arr_fileName[cID], 100);
currentClip.loadMovie("photos/thumbnails/" + _global.arr_fileName[cID]);
But currentClip._height and currentClip._width evaluates to 0...shouldn't the movie clip have the same height and width as the jpg?

Copyright Đ 2005-08 www.BigResource.com, All rights reserved