ActionScript 3.0 :: Resize Sprite To Stage Including Filters Area?

Apr 21, 2009

I want to dynamically resize and align a Sprite with a DropShadowFilter so it fits all Stage but in a way that the Shadow keeps visible.
 
The problem is that when I resize the Sprite it fits the Stage but it doesn't take the filter in consideration and the shadow is drawn outside the stage.

For example:

imageSprite.filters = createFilters();  // this method creates the DropShadowFilter
var s : Sprite = new Sprite();

[Code]....

Resizing Sprite 's' has the same effect as resizing 'imageSprite' and I couldn't find a way to get the size of the image+shadow.

View 7 Replies


Similar Posts:


ActionScript 3.0 :: Preloader + Stage Resize + Hide Area

Aug 26, 2010

i insert a preloader in a timeline of the fla , and move the movieclip for the stage resize and hid area menu in the second frame but i have the error #rror #1009: Impossibile accedere a una propriet o a un metodo di un riferimento oggetto null.

[Code]...

View 0 Replies

ActionScript 3.0 :: Get The Sprite Overlay To Stick To The Edges Of The Stage When Resize The Swf Window

Feb 28, 2012

Im trying to get the sprite overlay to stick to the edges of the stage when I resize the swf window. It works when you resize the width, but not the height.

[Code]...

View 2 Replies

ActionScript 3.0 :: Sprite Drag Area Is Too Big?

Jul 16, 2009

I've dynamically created sprites with graphics and added a text field dynamically to each sprite, displaying different text. These sprites (checkers in this case) are draggable. Without the text added to it, the drag area is very precise, dragging only when the circle is selected. However, when I dynamically add the text, there's a significant portion underneath and to the side of the sprite that is also draggable. This is really annoying when one sprite is placed above another because trying to move the sprite below causes the sprite with a lower y coordinate to move even though it shouldn't. When I tried to define a width and height for the text field to avoid this unnecessary space, it made the text much too small!

There must be some way to make it so only the graphics and text are draggable. I don't even mind if there is a square (like the old Flash 5 movie clip square) around the combined object, but there shouldn't be the white draggable space.

For reference, here is the code:

Code:

var i:int = 0;
var Rwidth:uint = 20;
var Rlength:uint = 20;

[code]....

View 1 Replies

Flash :: Simply Append A Sprite Into A Text Area?

Jun 7, 2011

How would I go about appending (not just changing the entire text area to this img, actually appending) a simple 25x25 image sprite into a text area in a flex project? using actionscript? (not mxml)

(it has to be a spark text area component, mostly because this is a flex mobile project and thats all thats optimized for mobile)

edit: I guess I should have said this, i know html text is the way to go about it. But my real confusion lies with first it being a Sprite, so i dont have a url to link to. It's an actual sprite var (it would be a file sent over the network in bytes, and saved in a sprite object.) and then the second part where im lost is APPENDING it to the text inline, so it doesnt replace any of the text already in the text area, and will be scrollable in the text area.

also, remember im trying to append this to a SPARK TEXT AREA component. I know i could just make a text field instance and thats it, but i cant find any information about appending this to a text area

EDIT AGAIN:
SInce there was some confusion about the sprite im trying to append, this is how the image is being transmitted,

it's starting out as just a standard cameraphone image, then..

var fs:FileStream = new FileStream();
fs.open(new File(imageURL), FileMode.READ);
var bytes:ByteArray = new ByteArray();

[Code]....

So then finally I have the image in imageSprite... and that brings us to my main problem appending this image in a TEXT AERA spark component. With an end result that will have the look of a picture message sent on an android or iphone.

View 4 Replies

Flex :: Image Won't Resize To Fit The Sprite?

Apr 13, 2010

I have this snippet of ActionScript code that is supposed to resize an image to fit the sprite: (as in rescale the image not just clip it)

[Code]...

View 1 Replies

ActionScript 2.0 :: New Resize() On Sprite Object?

Feb 28, 2007

I'm making a resize function that has to resize a Project object that extends Sprite.

But I keep ketting a type coercion error:
TypeError: Error #1034: Type Coercion failed: cannot convert AS:: Project@318ff89 to mx.core.IUIComponent.

I've tried casting the Project object to an UIComponent or DisplayObject, but this also throws a TypeError.

[AS]var resizeTarget:UIComponent = new UIComponent();
resizeTarget = UIComponent(target.getChildAt(0));
var myResize:Resize = new Resize(resizeTarget);[/AS]

So basically should I try avoiding the use of Sprites in Flex?

View 4 Replies

ActionScript 3 :: How To Scale Width Of Sprite To Resize

Oct 24, 2011

I have a sprite in as3 code, I want to enter its height to resize it, how can I scale the width accordingly?
sprite.height = 200;
sprite.width = ??

View 2 Replies

ActionScript 3.0 :: Resize A Sprite Without Resizing Contents?

Feb 12, 2010

How do you resize a sprite without resizing the contents? For example the script below create a sprite, attaches it to the root, creates a button, attaches the button to the new sprite then resizes the sprite. but it scales the button when I try to resize?[code]...

View 9 Replies

ActionScript 3.0 :: Sprite Resize Event Listener?

Jun 8, 2009

I'm currently working on a center stage component and I was wondering if there's a good way to detect when a stage component has been changed if any of the elements inside it have been enlarged?

This seems like it should be available but I can't find one that doesn't fire before the redraw. Or at all for that matter.

View 1 Replies

ActionScript 3.0 :: Load The .swf With The Exact Stage Size So The Graphic Elements Do Not Float Outside The Loaded Movies Stage Area?

Sep 7, 2010

I'm making a mockup for a client and I need to Load the .swf with the exact stage size so the graphic elements do not float outside the loaded movies stage area. [URL]Basic load code I'm using...

Actionscript Code:
import flash.display.*;var adLoader1:Loader = new Loader();adLoader1.load(new URLRequest("100828_budlight_texas_fight_728x90_jn.swf"));adLoader1.x = 313;adLoader1.y = 162;addChild(adLoader1);var adLoader3:Loader = new Loader();adLoader3.load(new URLRequest("100828_budlight_texas_fight_300x615_jn.swf"));adLoader3.x = 738;adLoader3.y = 0;addChild(adLoader3);

View 3 Replies

ActionScript 2.0 :: [FMX2004] Resize Images In Flash To Fit The Masked Area But Proportionately?

Jan 24, 2006

Basically I'm trying to resize images in flash to fit the masked area but proportionately....

My mask area is:

Code:
width = 478;
height = 420;

now consider that the the max width I want my pictures to be. This doesn't have to be exact. Now what I came up with to resize proportionatly is:

Code:
//width & height are my mask deminsions ( which i wanna resize my pics to)
//width_orig & height_orig are the deminsions of each new loaded pic.
height = (width / width_orig) * height_orig;
width = (height / height_orig) * width_orig;

That does scale them proportionatly but some of the times it will resize a lil bit smaller than the image area which I don't really want. Like I said this doesn't need to be exact. I would prefer it to be a lil bit bigger than the masked area. I just need to make sure the pics are scaled proportionatly.

View 1 Replies

Actionscript 3 :: Centering Objects On Stage And Auto-Scaling With Stage Resize

Oct 19, 2011

I'm writing a web based flash app that's written entirely in AS3. I have objects on the screen as part of a GUI. I would like the user to be able to resize the window, or make it full screen. I would like everything to auto-scale with the resize, but also remain in the same relative position on the stage.

View 1 Replies

ActionScript 2.0 :: Position A Movieclip In The Middle Of The Stage Even If The Stage Or Window Resize?

Feb 27, 2006

i saw a thread while ago .. that always position a movieclip in the middle of the stage even if the stage or window resize any1 can point me to it

View 3 Replies

ActionScript 2.0 :: Adjusting Columns And Rows On Stage Resize, According To Stage.width?

May 10, 2008

When you resize the browser window the thumbnails rows and columns adjust accordingly to fit.I've managed to attach the thumbnails correct when my enableButtons() function is called but i'm unsure how to approach resizing.

Stage.align = "TL";
var numberOfGalleries:Number = 20;
var thumbMarginX:Number = 163;
var thumbMarginY:Number = 109;

[Code].....

View 1 Replies

ActionScript 3.0 :: Can't Get Stage Resize Listener To Resize Movieclips In "main" Swf

Sep 9, 2009

I've got a large bitmap (1920 x1306) that my client wants as a bg image, scaled to the swf size on load (930 x 575); but that can "grow" up to its original size if/when a user expands the browser window. All the rest of clips in the display list are to remain in place (except for a copyright clip, which they want to always be 14 pix above the bottom of the browser frame. I've tried loading the bitmap dynamically at full size and then using scaleX,scaleY to set it's initial smaller (930x575) size, and I've tried just setting the height/width of the dynamically loaded image using the math of scaleX,ScaleY just in case the scaleX "transformed" the bitmap so that it couldn't return to its original size.  Both make the bitmap the right size. But the resize function below did  nothing to it, (or the copyright.y.) THEN I tried just putting the bitmap into the display list (both sizing methods work here, too). But even as an original member of the compiled display list, the resize event is still not reaching the target. Everything I've seen on the web says this should work - but...no luck.
 
Here's the AS3 code in the 1st frame of my swf:
 
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;

[Code]......

View 1 Replies

ActionScript 3.0 :: Set A Clip Area For A Movie Clip Or Sprite

May 1, 2010

Is there a way to set a clip area for a movie clip or sprite so that it will not draw out of that particular area? I am using a drop shadow, and it doesn't look right if the shadow passes a certain boundary, so I wanted to find a way to force it not to draw out of a particular area.

View 1 Replies

Flash :: Get Rid Of Stage Area?

Jul 15, 2011

I have my flash doc. and I used a mask to give it rounded corners but you can still see the stage color. I am new to flash so I can use the help. How do I get rid of this or can you even do this?

View 2 Replies

ActionScript 1/2 :: Place On A Particular Area Of The Stage?

Jul 30, 2009

I want to place my duplicates about one third down from the top and in a small bit from the left.  Roughly centre them on stage.  My code so far:
 
for (var i = 1; i <= 6; i++){ duplicateMovieClip ("fish_mc", "fish_mc" + i, i); _root["fish_mc" + i]._x = 500 * Math.random (); _root["fish_mc" + i]._y = 350 * Math.random ();}

View 9 Replies

Expanding The Work Area Outside The Stage?

Nov 25, 2009

I currently have an small animation job that involves an enormous zoom out. To do this I need to scale the symbol containing all the animation out in the main timeline, from extremely close to quite far away.
 
I have two problems that are preventing me from doing this satisfactorily.
 
Firstly, the transform panel doesn't work. Specifically, entering scale values only seems to work beween 0 and 100%, anything larger gives unpredictable results.
 
Second, the symbol has become too large for the work area (I have zoomed out as far as I can go) - how can this area to spread out to the whole of the graphic editing area, instead of the third of it that is on the left side?
 
For example, I have used the Free Transform tool and scaled the item up 2500%, and now it's too big for the limited work area. To scale it further, or scale it back, I need to enter scale amounts into the Transform panel. After doing this, the figures I enter turn into arbitrary other values and my symbol either warps or disappears entirely.
 
Ideally, I should be able to look at the stage itself, click on the symbol, scale it in the Transform panel to 3000% and be done with it.

View 2 Replies

ActionScript 3.0 :: The Stage View Area?

Sep 2, 2009

Once again i'm a bit lost XD. The deal is, that i'm making a dynamic "blog like" news viewer, so, when i got more than 2 news (sometimes even with one), all the rest of the news get out of the stage and are not seen.

I have been reading methods about changing the stage size but the question is here, if i manage to change the stage size, all the content will be scaled too, isn't it? That's exactly what i don't want.

then, how do i change the "view area" of the stage.

View 6 Replies

ActionScript 3.0 :: Spawn A MovieClip Somewhere In The Stage Area?

May 30, 2009

I have a mini-game where I have three movieclips:The player (controlled by mouse); A random object that moves around the stage (like the arkanoid ball without the paddle and the blocks); A simple power up.The game is simple: hitting the power up increases your scoreThe game ends when the object hits the player.The question is:How can I spawn the power-up (randomly) on the stage area, every time the player hits it?When that happens I want the following events to occur:1) The power-up to be removed;2) Increase the score by 1.3) Place a new power up randomly on the stage.4) Rinse and repeat.

View 12 Replies

Professional :: Area Outside Of Stage Shows Up On Website?

Apr 29, 2010

I was at a friend's house and wanted to show him our website.  When I navigated to it, about 10% of the area outside of the stage was visible.  It was almost as if the swf had been shrunk by 10%, but still within the stage area (750px x 600px).  I'm not sure what's causing it, but I've seen it happen once before with a computer here at our office.

It always seems to happen with Internet Explorer.  When we right-clicked on the swf and choose "show all" it filled the area and looked normal.  I've never encoutered the problem using Firefox and only some of the time when using Internet Explorer.  Not sure if it just happens with a certain version of IE or what.[URL]..

View 1 Replies

Actionscript 3 :: Capture Stage Area Using BitmapData?

Mar 15, 2010

I am trying to grab part of stage area using BitmapData and copyPixels method:

bmd = new BitmapData(stage.stageWidth, stage.stageHeight);
bmdRect = new BitmapData(320, 240);
rectangle = new Rectangle(360, 20, 320, 240);
bmdRect.copyPixels(bmd, rectangle, new Point());

[Code].....

The result i get is an empty .jpg I m pretty sure that the error is in the Bitmap procedure and not the saving one...

View 2 Replies

ActionScript 2.0 :: Export A Specific Area Of The Stage?

Aug 30, 2009

I would like to export a specific area of the stage. So, for example. My stage is 400 x 400 and I would like to export only 100 x 100 of the stage at xy 0 pos.

View 6 Replies

ActionScript 2.0 :: Randomly Place Mc On Stage EXCEPT For One Area?

Jul 3, 2006

I want to load some mcs randomly on the stage, except for a footer area at the bottom of the stage. Is there a way to exclude just a certain part of the stage using something like Math.random()*Stage and then specifying the bottom 300 pixels as off limits?

I'm using the whole stage because the swf is embedded 100% across the browser, so I can't restrict the dimensions.

Code:
onClipEvent (load) {
x = this._x=Math.random()*Stage.width;
y = this._y=Math.random()*Stage.height;
}

View 14 Replies

ActionScript 3.0 :: Sprite Won't Display On Stage

Aug 27, 2011

I'm sure you're expecting me to have forgotten to use addChild. I wish it was that easy. I will say I'm very new to AS3.0. I have a movie clip in my library that contains a small PNG file and a text label. The linkage properties are: Class: shapes.HorizontalIcon, Base class: flash.display.Sprite.[code]As far as I can tell this should work. There are no errors. The trace statement above shows up in the output. The parent sprite is also an item from the library. It shows up on the stage. I tried adding a random TextField to the parent sprite it showed up on the stage just fine.Something isn't working right, but I don't know where to start debugging this.

View 7 Replies

ActionScript 3.0 :: Create Several Sprite On The Stage?

Nov 15, 2010

ActionScript Code:
var MapBtnArray:Array = [];
var MapBtnSprite:Sprite;
var i:int;

[Code].....

I'm using to code above to create several sprite on the stage, but when I click on the sprite, the index of each trace work just fine (output of J is according to the target i click); however MapBtnArray[j].x keep equals to "0"

I want the coordinate of the sprite on stage, how come what i get is "0" instead?

View 1 Replies

ActionScript 3.0 :: Speed Up Text On Stage Design Area?

Aug 12, 2009

how to speed up the workspace when there happens to be a large amount of text on the stage? I have tried everything I can think of (even choosing outlines only for the layer). It seems to slow down my system even if the layer is not visible. Now doing anything is a chore. I have a pretty fast system, and it's pretty bad that after all these flash iterations I still can't have text on the stage and continue work.

View 3 Replies

ActionScript 3.0 :: Drag Some Bitmap Area On Main Stage

May 12, 2010

I am trying to distort a bitmap, I mean, I have this bitmap in the main stage and I want to drag a section to. I don't know, maybe drag the eye of the character in the picture but I want all the bitmap to react or at least the closest region of the point I am dragging. Is that possible? I know the drawTriangles() that is been use to gave this 3D effect, but I need something different.

View 3 Replies







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