ActionScript 3.0 :: Make Any Size Of DisplayObject Fit A Thumbnail Container?

Jul 8, 2010

I am going to have a situation where i have all sorts of different sizes of graphical data coming at me from XML. The only thing that all of these assets have in common is that they will be sharing a 100px by 100px thumbnail and they are SWFs.My question is, how can i make an object fit into the thumbnail so that:1) Theres no cropping of the item2) Items smaller than 100x100 must be enlarged3) Items larger than 100x100 must be shrunk

View 7 Replies


Similar Posts:


Flex :: Make A Container Resize Based On The Size Of Its Contents?

Mar 16, 2010

I'm trying to create a Flex application that can automatically shrink based on the size of the components that it contains, so that a user can shrink it to a minimal view to see more of the HTML page it's embedded in.

I know how to change the size of the whole application using ExternalInterface, but I'm having trouble automatically figuring out how much the size changed when something is hidden or shown.

For example:

Let's say I have the following flex layout:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:VBox width="100%" paddingTop="0" paddingBottom="0"

[Code]....

How can I hide one of the text fields and cause the VBox to shrink? I'm currently setting it to visible = false, but that doesn't seem to affect the parent VBox.

Once the VBox shrinks, how can I detect that the Application no longer needs so much space, and then go about figuring out how much less space it needs?

I've tried using ResizeEvent, but I haven't been able to get them to work, but I could be doing something wrong.

View 1 Replies

ActionScript 3.0 :: Pass In A DisplayObject To A Container In A Specified Frame Of A MovieClip?

May 31, 2009

In a project, I need to pass in a DisplayObject to a container in a specified frame of a MovieClip. (for example a "container" instance at Frame 15)

I thought it should be just okay with this code:

Code:trace(mc.currentFrame);// Output 1 - we are at the first frame of this mc.

[Code]...

If the timer delay is set to 1, the container is still not available, but if it's set to 100, it's okay. Then I make this delay bigger and bigger, the threshold value is 25. (My FPS is 30)

View 1 Replies

ActionScript 3.0 :: Get Rid Of Image In Container / When Click On Thumbnail

Jul 4, 2010

I'm having trouble trying to get rid of an image in my container when I click on a thumbnail. I keep getting an error saying DisplayObject must be a child of the caller.I've looked around the web and can't figure out what I'm doing wrong, nor am I sure what the error means when its referencing the caller.[code]

View 3 Replies

ActionScript 3.0 :: Flash DisplayObject Container Matching All Elements With AddChild() On Criteria?

Mar 1, 2012

I'm coding this minigame implementation where a sprite traverses tiles on a screen, and when he's done traversing a tile, the tile "disappears" (its alpha decreases and it becomes a "wall" the player can not move onto). Now, simple enough. Make use of a traversing and traversed boolean arrays to store if a tile is currently being traversed, or if it isn't, but it has been traversed. So, if traversing == 0 and traversed == 1, make the tile "disappear". However, and here's the weird part, if I just set the alpha to, say, 0.5 in this if statement, it sets the alpha on just the tile I traversed, whereas if I try to make it part of the wall as well (in the same if), every tile except the one I've traversed to becomes a wall.

Here's part of the code (it happens in the enterFrame game loop):

Code:
const NUM_TILES = 15;
//Add MC for all the tiles
var tiles = new MovieClip();
addChildAt(tiles,5);

[code]....

View 1 Replies

ActionScript 3.0 :: Generate Bitmap Thumbnail For Container - Zoom Out?

Jun 9, 2009

I found this quite amazing website [URL] and If you see the website when you zoom out there is no animation neither interaction with the content of each container, I mean, if you see the first one, the home container there is a animated banner, however when you zoom out that banner stops. Also, you if see, every time you zoom in a container it loads its content, if you zoom out and zoom in again it loads again the same content...this is cool because you're not wasting too much memory and you're not creating a huge .swf file.. Are they generating some kind of bitmap thumbnail for each container everytime we zoom out or what?

View 3 Replies

Flash :: Get Visible Size Of DisplayObject With Perspective Projection

May 2, 2010

The following is entirely a math question. As we know, PerspectiveProjection delivers perspective transformations in 3D represented by the interdependent values of fieldOfView and focalLength according to the following formula:

focalLength = stageWidth/2 * (cos(fieldOfView/2) / sin(fieldOfView/2)

Q: How to get the visible on-screen size of the DisplayObject (Cube on the above-linked image) to which PerspectiveProjection has been applied? A more thorough description and illustrative code on the issue in ActionScript 3 lacks functionality for visible bounds of DisplayObject.

View 1 Replies

Actionscript 3 :: BitmapData Thumbnail Fix Size?

Sep 4, 2011

How to make the thumbnail a size of 84x84 pixel?

function createThumbs()
{
_myThumbData = new BitmapData(photodefault.width,photodefault.height,false,0xffffff);
photothumbs.t1.addChild(createBitmap(_myThumbData));
function createBitmap(bmd:BitmapData):Bitmap

[Code]...

View 1 Replies

ActionScript 2.0 :: Thumbnail Size And Order?

Sep 17, 2009

I use kirupa's xml gallery with thumbnails. I'm trying to do something but couldn't manage yet.What i am trying to do is different widths for thumbnails. I managed to do thumbnails with different widths(same height) but the order of them doesn't match with the xml order.
here is my code.

Code:
target_mc._x = 5+prevx;
prevx = target_mc._x+(target_mc._width+5);

If i do that at everytime the order of them changes.here is my whole code :

Code:
resxpro = Stage.width;
resypro = Stage.height;
stop();[code].....

View 2 Replies

ActionScript 2.0 :: Xml Thumbnail To Full Size Image?

Jan 20, 2009

I'm tring to have it when you click on a thumbnail, it loads a larger image over the scene. Here is an example, since I'm sure that my desc. is awlful. link My scrolling thumbnails are based off of the tutorial on kirupa.com. Here is my site. and action script. (architecture is only one that has any images on it currently for testing)

Code:

cliparray = [];
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;

[code]....

View 7 Replies

Apply Dynamically Scale Down And Up Into A Thumbnail Images Size?

Jun 9, 2010

I'm working on one current project, I don't have any issues to load a SWF into a main SWF but I can't figure out how to apply dynamically the scale down and up into a thumbnail images size while using the Resize event handler to fit in any browsers sizes.

I load SWF into a Loader object then add it into a container => currentMC. I want to size it and keep all the pieces inside this container. Therefore no matter browser size, I just want to be able to apply scale on it to fit it.

Does anyone know how to do that? How would I deal with stageWidth and stageHeight?

View 1 Replies

ActionScript 2.0 :: Resize A Square So That A Thumbnail Size Image Comes Through?

Jun 29, 2006

just wondering how to resize a square so that a thumbnail size image comes through

heres the link peeps: its awesome [URL]

View 1 Replies

ActionScript 2.0 :: Thumbnail Size In Photo Gallery Using XML And Flash Tutorial?

Jun 13, 2010

Based on the Photo Gallery using XML and Flash tutorial found here:I&#65533;m having trouble with loading thumbnail images of various sizes which overlap if they are smaller than the previous image.The specific line that causes this is target_mc._x = hit_left._x+(target_mc._width+5)*k;I&#65533;ve tried all sorts of things with the closest being the following which put the images in the right size, but with the omission of &#65533;k&#65533; their order is backwardstarget_mc._x = (thumbnail_mc._width+5);Here is the full function block as per the tutorial

View 2 Replies

ActionScript 3.0 :: Measure The Size Of The Container?

Aug 9, 2011

how to measure the actual size of the container just like the Flex components. I wanna create some containers with my own layout arithmatic, so I must know the size of every child, but sometimes I don't know what's the size which DisplayObject or DisplayObjectContainer that I will add to the container actually is, how can I do?

View 1 Replies

ActionScript 3.0 :: Intercept The Window Size Of The Swf Container?

Oct 29, 2011

I wanna know if exist a class in AS3 that allow to intercept the window size of the program in wich sfw is executed. For example the browser window size

View 2 Replies

ActionScript 2.0 :: Customize The Size Of The Container And Thumbnails?

Aug 19, 2005

Is there a way to customize the size of the container and thumbnails for this tutorial? Say I want to have a larger display of my images.

View 2 Replies

ActionScript 3.0 :: Stroke Size Halved For MovieClip Container

May 26, 2010

Is there a way to have the full stroke size (height/width) fully included or excluded in the movieclip symbol?If I'm making a rectangle with size 100, adding dynamically lines of size 20 when certain criteria are reached in game. But I also want to have stroke of size 5-6, problem is that they half their size in included in the rectangle 100 of height, and half are outside.It makes it more tricky to make the formulas to take in consideration the 2.5 for the size and also the effect on x positionning etc. Much easier to just have to do the like of "x += 20" without the assle of calculating the half stroke height.So how to have those stroke included/excluded when converting to symbol?

View 1 Replies

ActionScript 3.0 :: External Textfield Ignoring Container Size When Set To Autosize?

Mar 3, 2010

Really not enjoying myself with AS3 - it's about as userfriendly as an airplane cockpit. I'm sure Flash the program is quite happy with it, but spending hours into weeks trying to implement pretty ordinary functionality is getting really tiring.
 
I have a textfield loading in html/CSS file. The textfield is in a container mc. I'm trying to use a scrollbar on the textfield, and I need to set the textfield to  newsText.autoSize = "left";. When I do this, the textfield displays the entire contents of the html file in the swf, ignoring the textfield size AND the mc size, displaying all the lines in the file in howover many lines are in the html file.
 
I'm autocenting my swf in the browser, so this of course throws the whole thing off center.

[Code]...

View 1 Replies

Flex :: How To Get Size / Coordinates Of Content Area Of Container Objects

Jul 21, 2010

How do I get the size of the content area of Container objects? One non generic solution is checking for styles I suppose but I am looking for some code that works generic for all standard flex Container objects. The controls are Flex 3

View 1 Replies

Flex :: Drag - Change The Size Of Container With Mouse Dragging?

Dec 21, 2011

When you drag the edge of container with mouse ,how to implement changing the size of container?

View 1 Replies

ActionScript 3.0 :: Putting Video Object In Container To Control Size

Jan 13, 2009

I have a video object that dynamically changes. I want to put that inside of a movieclip that is always 320,240 no matter what the video object size is. I want the video object to increase or decrease but I always want to display it at 320,240. How would I write this? I tried:

ActionScript Code:
videoDisplay = new Sprite();
videoDisplay.graphics.beginFill(0xCCFF00,100);
videoDisplay.graphics.drawRect(0, 0, 320, 240);

[Code].....

But the video object still is large (my video object is 480,360 in this case). It seems like it is not nested inside of the the videoDisplay sprite which should only be 320,240.

View 1 Replies

Flash :: Make Size (width And Height) Full Size In The Browser?

Sep 15, 2011

I would like to know how to make flash size (width and height) full size in the browser? the real size of flash is w:955px h:600px I tried to make w:100% and h:100%, it makes pictures pixelate.

View 6 Replies

Actionscript 3 :: Adobe Flex - Way To Automatically Change Font Size To Fit In Its Container?

Sep 8, 2009

I have a component in Flex, and part of that component is a label. Is there a way to automatically adjust the font size to fit into its container?

View 1 Replies

Flex :: Limit The Size Of A Child Container With Percentage Width/height Of 100%?

Mar 11, 2011

How can I limit the size of a child container with percentage width/height of 100%?

Example:

<mx:HBox id="container" width="100%" height="100%">
<mx:HBox id="scrollContainer" width="100%" height="100%">
<!-- keep this content limited to the size of "container" -->

[Code]....

Apparently I can get the desired behavior if I change HBox to Canvas but I would still like to know how to accomplish this with a HBox and why it differs from Canvas.

View 3 Replies

Actionscript 3 :: Make A DisplayObject Popup Like Flex PopUpManager?

Apr 20, 2011

How can I make a DisplayObject popup like Flex PopUpManager in AS3?

View 1 Replies

ActionScript 3.0 :: Make Filters Scale Relatively With Parent DisplayObject?

Nov 28, 2009

S there any way filters applied to a DisplayObject (drop shadow, glow, bevel) can scale relatively with the parent (the DisplayObject it is inside)?And what about other properties like .distance for drop shadow?For example... If I have a 100px rectangle with a 10px glow inside a container object, and I set scaleX/scaleY of the container to .1, I want the glow to inherit the scale change from the parent (1/10th the size) just as the display object does that the filter is applied to.Instead, if you try this, you will see the glow stays at 10px no matter what scale the filter target or the container is transformed by.Pseudocode example (steps to reproduce),

1) create a sprite called _myOuterSprite on stage at scaleX = scaleY = 1

2) create a sprite called _myInnerSprite inside _myOuterSprite at scaleX = scaleY = 1

3) draw 100px rectangle into _myInnerSprite

4) apply 10px glow to _myInnerSprite

5) transform scale of _myOuterSprite to .1

Result:

- child sprite (rectangle) scales to 1/10th the size

- glow stays the same size

How can I make it so that glow scales to 1/10th as well?

...without capturing and scaling bitmap data

...without losing interactivity on objects

...in a way that would work visually for every filter, not just glow (drop shadow has distance property too, etc)

View 7 Replies

Flash :: Make Thumbnail From Swf In Php?

Dec 25, 2010

I have to make thumbnails from banners in swf file format (flash 9). I want to use php, but if that's not possible anything which work in a linux command line is fine by me.

I tried to open them with ffmpeg-php, but it says: Can't open movie file /where/the/file/is

The file is there and is readable by the user.

View 1 Replies

ActionScript 3.0 :: Flex - Make Filters Scale Relatively With Parent DisplayObject?

Nov 28, 2009

(i'm using flashdevelop / flex sdk)IS there any way filters applied to a DisplayObject (drop shadow, glow, bevel) can scale relatively with the parent (the DisplayObject it is inside)?And what about other properties like .distance for drop shadow?

For example... If I have a 100px rectangle with a 10px glow inside a container object, and I set scaleX/scaleY of the container to .1, I want the glow to inherit the scale change from the parent (1/10th the size) just as the display object does that the filter is applied to.Instead, if you try this, you will see the glow stays at 10px no matter what scale the filter target or the container is transformed by.Pseudocode example (steps to reproduce),

1) create a sprite called _myOuterSprite on stage at scaleX = scaleY = 1

2) create a sprite called _myInnerSprite inside _myOuterSprite at scaleX = scaleY = 1

3) draw 100px rectangle into _myInnerSprite

4) apply 10px glow to _myInnerSprite

5) transform scale of _myOuterSprite to .1

Result:

- child sprite (rectangle) scales to 1/10th the size

- glow stays the same size

How can I make it so that glow scales to 1/10th as well?...without capturing and scaling bitmap data ...without losing interactivity on objects...in a way that would work visually for every filter, not just glow (drop shadow has distance property too, etc)

View 4 Replies

Flash :: Check If DisplayObject A Is A Descendant Of DisplayObject B?

Oct 26, 2010

I would like to be able to quickly check if a given DisplayObject is a descendant (not in the inheritance sense - ie. child, grandchild, great-grandchild, great-great-grandchild, etc.) of another DisplayObject. There doesn't seem to be a native way to do this and I can only think of two ways to achieve it: Create the mother of all nested loops. Seems a bit, I dunno, wrong? Dispatch a bubbling event at the 'child' and check if the potential 'parent' receives it.

[Code]...

View 2 Replies

Make Scrolling Thumbnail Panel Continuous?

Mar 30, 2009

I have just done the tutorial for the scrolling thunbnail panel but now I wish to make it continous is this easily done? I saw the xml perpetual scrolling thunbnail post in the forum, is this the same thing?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved