Actionscript 3 :: Scale Different Sized Videos Proportionally In Flash?
Feb 14, 2012
So I have created my vdeo player , but Im havin problems handling different sized videos. How to properly scale videos proportionally? I get original width and height from metadata object:
This script loads the images dynamically using xml so getting the size of the image to use as a start provides to be a problem, since there is no image to begin with.I found script to be able to scale an image with the stage here:But this only works on a image that is already in the flash file, not one that is loaded dynamically like I'm doing with xml.
I'm creating a simple liquid flash site layout with one MC that does not scale and remains at a constant position, and one mc that should stretch to fit either the height or width (whichever's larger) of the stage, but scale proportionally. I thought I had a pretty good grasp on the code for that, but when I put it in, the mc doesn't scale at all, in fact it just disappears! Could anyone take a look and let me know if you see what's wrong?
My site has a header and footer and then has an empty mc the full size of the stage (overlaps the footer and header). I'm loading 3 separate movable windows into this mc. I would like both the header and footer to scale proportionally with the browser (including the empty mc.), but not the windows. So basically I want everything to scale but the windows as they have pixel fonts.I'm not happy with my current website because its not scalable and when I drag the windows around I have huge margins on larger resolutions. Since my header and footers are vectors I realize I can make things alot more flexible if I can just figure this out.
I'm having a bit of trouble with this logic. My setup is typical, with a content MC and a handle MC the runs along a track with specified bounds. All I want to do is have the handle height adjust based on content height but in relation to the track height?
My Flash image will not scale.if you zoom in, it gets chopped up. if you zoom out, it has a big blank area.What should I change in order to have this Flash image scale just like the rest of the site? [URL]It is the Flash in the center.
I've embedded swf's countless times and haven't run into this wall before. The original swf dimensions were 900px x 550px. I need to fit the swf into an area that's only 560px wide. So I embed with the width and height of 560px x 342px. The problem is the swf seems to scale to a fraction of the actual stageWidth. I've run numerous tests, and the stageWidth/stageHeight are being read in properly before any of the assets are being created on the stage.
I know that the swf fill the entire 560x342 area because there's an asset that follows the users mouse and does so within those bounds. Another strange issue, is there's a right-click menu, that once clicked, creates a message that pops up and is centered to the stage, yet that centers itself to the area that's not being scaled properly. It's almost as if I'm dealing with 2 different stages.
I've attached an image that hopefully demonstrates my issue. The black area represents the supposed stage, where the gray represents the area the swf is taking up when embedded in the page. The stage align is set to TL, and I've switched between all the scale modes with no success.
I need to scale an image so that it won't distort. Of course I don't know the dimensions of this image.I tryed something like this but it doesn't seem to work at all.
I'm loading an external swf that calls an XML file and plays a slideshow animation that enlarges or contracts the pics being loaded (similar to a Ken Burns effect).
The external swf is loaded into a movieclip holder named "mc" on the main fla file. The movieclip holder's dimensions initially, are the same as the fla file. However, I want the loaded swf to scale proportionally according to the stage after it gets resized. So, if I click and drag the stage so that it is wider, the movieclip holder's width also widens, but it's height scales proportionally.
If the externally loaded swf had content that fit the stage exactly, without any hidden objects offstage, the movieclip playing on the main fla scales proportionally without any problem.
Problem, since the externally loaded swf is animated with pics that get bigger or smaller, or even pan from left to right, the size of the movieclip on the main fla file resizes NOT according to the movieclip holder's width and height, but to it's content's width and height that are constantly changing.
I think you can guess my question now. How can I get the movieclip holder to resize proportionally according to it's own width and height, and not it's content's width and height?
Here's the code I have so far. Note that I created a movieclip called "mc" on the main fla file.
is there some way to resize all the animation, all the symbols in all keyframes proportionally? I did all the animation, but now I realize thatīs too large on the stage.
I need to scale a movieclip to fit the width of the screen and it's height to stay proportional. I have code that's always worked fine but, in this case, the movieclip is constantly changing size and this throws off my code, scaling it incorrectly when using a listener (it's initial scale is perfect).
I imagine it's because it has shifted from the size it's proportions were read from by the time it applies them. I know my problem is theoretically solvable because the movieclip can be scaled correctly if I scale width and height equally. However, I need the movieclip to always be the width of the screen.
I have a problem where I am trying to make the second, minute and hour hand tick correctly.I made timers with 1000 ms, 60000 ms and 3600000 ms initially and that worked but i wanted it to speed up so I divided all 3 by some amount,However, when I did that the minute hand and hour hand starts ticking way too soon in relation to the second hand Is there something I did wrong in the scaling down of the milliseconds?
I am programming an application I cannot get into specifics but I am working on a way to scale everything up on a stage from 640 x 480 to 1024 x 768 this would include loaded images, textfields, and a movieclip being used as a background. The document size has to start as 640 x 480 as the application needs to be that small.I am using action script 3.0 and a seperate .as document and no code in the time line although if necessary I am familiar with simple action script 2.0 conversions. I have looked around for tutorials/adobe live docs.Are there any tutorials or has anyone done this before and would be willing to explain how I could accomplish such a feat. If possible the final resize and upload to server could be done without being seen it would be amazing. But if impossible I could just upload the small image to the server than use cross php / flash to resize with php and send the link to the image location back to flash.
If I have to use php to send the information how can I communicate between php and flash, much of the documentation and tutorials are too weak explaining how the php end works and how to communicate properly in as 3.0.After doing this I would like to take a snapshot or copy of everything on the stage at 1024 x 768 and send a jpeg,png, or gif to be stored on a server.
I have a simple test site to test scaling images proportionally.[code]The site is full browser with 3 MovieClips - header_mc, body_mc and footer_mc.header_mc is the strip across the top. body_mc is the middle section, which contains a image that is a MC, img_mc. footer_mc is the bottom strip.When the browser resizes, header_mc and footer_mc stay the same height, but the height of body_mc will change and footer_mc sticks to it's bottom.When the window resizes I want the image to resize proportionally - that's where I'm stuck.How can I resize the image to keep it's proportion.
What I'm wanting to happen is that when the "body" movie clip changes size, I want the objects within it to be scaled proportionally (keeping the x:y ratio the same). The result that I'm wanting will result in the contents (as a whole) being proportionally scaled to the height (because it will always be the smaller dimension in my case) of the current size of the body mc.
I've uploaded my .fla so you can see what im working with. The red square is the body that i've managed to scale but I have not yet added anything within it. (I have tried but it's contents distort when the body is resized)
Scenario: main moveiclip with 4 other clips in it. I want the rolledover clip to scale up and all the others to scale down and blur.
Question: What is the most effiecent way to code this. Would it be a "for in loop"? I am trying to minimize the code and would rather not use a whole bunch of if then statements.
I've made a slide show and I've been successful so far. However, I'd like to add some thumbnails right below the original image (original size).Here are some specifications of the thumbnails:Size: 50 x 50 px.The image sources of the thumbnails and the original image are the same.Therefore, I'd like to resize only the movie clips for the thumbnails because the actual image file dimensions won't be changed.I tried simply setting the width and height of the movie clip to 50 but it lost quality and you get jagged lines in the image. Does anyone know a good algorithm to resize an image inside a movie clip proportionally and without losing quality?Btw, I'm using an XML files to store the images so you have to include the Loaders and stuff, what I really need to know is how to resize images without losing quality.
How can I convert the current scale of the instance to 100% so I can easily "visualize" and manage the instance when I modify its scale? Here's the actionscript, it works, but I just want the temp._xscale and temp._yscale to be in percentages, not real numbers.
Code: USflag.onMouseDown = function () { var temp = USflag; onEnterFrame = function ()
[code]....
One last thing, what's the tag you have to put that is designed for boxing actionscripts? I'm suing [ code ][ /code ]
Does anyone know if it is possible to dynamically add a movie clip to the stage with text and have the size of the movie clip dynamically generated by the amount of text?In other words I am trying to make a word bubble but the amount of text in the bubble will vary in size and I need the bubble to size accordingly. Maybe someone knows of a tutorial online that I can use. My searches have not been successful.
I followed tutorial [URL] on making a gallery with thumbnails. However, each thumbnail has to be of same width....if not the order of the thumbs gets mixed up. I've been trying to alter the thumbnails_fn(k) function, or more precisely this line: target_mc._x = hit_left._x+(target_mc._width+5)*k;
Ok im new here and to Flash programing... so its safe to assume that i know close to zip. I've based it on the "XML and Flash Photo Gallery" tutorial by one of the guys on here. The centering bit i looked at another forums post. I use a MC(bg) and inside that another MC(photo) two buttons "pervious_btn" "next_btn" I load my images via "images.xml" It loads everything and it centers the 1st image(276x184), but it keeps the 1st image coordinates for the rest which is 640x480 and 480x640... thats where the mess comes in. It doesnt center the next image.
I know lightbox is there and easy to use but I dont want to because of the settings you have to set on the Adobe site for it to allow access and all that... besides i really like Flash! Is there a way to perhaps "reset" the MC, or coordinates before loading the next image?
I am trying to copy multiple movieclips to one movieclip using BitmapData.
I am trying to clear out the old bitmapdata from the movieclip that I am adding my bitmapdata to. The two movieclips I am copying are different sizes and shapes so I can't just overlap them.
I have an attached movieclip that duplicates boxes vertically. All the boxes are different heights, because I've scripted it to adjust with the amount of xml text contained inside these boxes.
How do I get these boxes to line up right without overlapping eachother?
need to fill a grid with tiles that will be of different sizes,but all multiples of the stage size - something like this:I want to randomize number of tiles placed into the grid without having any tile overlap. It will then place a tile at a random position on the grid, but not in any grid cells that have already been covered by a tile. And...also I want the grid/tiles to be dynamic enough to scale if the stage is resized.