ActionScript 3.0 :: Created A Sprite Gradient Box As Background?

Apr 10, 2009

I have created a sprite gradient box as my background in my flash as3 file (using tweenmax). As i'm trying to make this a full screen swf on the browser window, i set the width and height according to the stage.

My trouble is that when I resize my browser, the gradient box does not resize with it... it only does when i refresh the window with the new width/height.

Is there a way I can put a redraw function in an event handler that will recognize the window resize? If this is hard to understand... can my background become bigger at the same time as the window is being dragged to a new size?

[Code]...

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Flash : Create Gradient Fill, Transparent Background And Radial Gradient?

Dec 26, 2011

I'm trying to create spinning rays in actionscript to use in my website.Below is the rough idea of what i'm trying to create.Is it possible to create absolutely with 0 images.Following is the actionscript code in which i couldn't figure out how to add gradient, transperant background and little radial gradient to create glow effect.

Code:

function CreateRays():Shape {
var ray:Shape = new Shape();
ray.graphics.beginFill(0xFF9900,.5);
ray.graphics.lineStyle(1,0xFF9900,.5);

[code]....

If you paste above code in 1st frame of your scene with nothing on your scene, it will give you sweet rotating rays!

View 2 Replies

ActionScript 3.0 :: Changing Gradient In Sprite From Library

Apr 4, 2009

I would like to be able to make changes to a colour gradient of a sprite from my library, as opposed to one drawn dynamically. So the code I thought would look something like this:

Code:
var radType:String = GradientType.RADIAL;
var radMatrix:Matrix = new Matrix();
radMatrix.createGradientBox(120,120);
var radColours:Array = [0x3174d0, 0x15396f];
var radAlphas:Array = [1, 1];
var radRatios:Array = [0, 255];
var myLibrarySprite:spriteInLibrary = new spriteInLibrary();
myLibrarySprite.graphics.beginGradientFill(radType, radColours, radAlphas, radRatios,radMatrix);
addChild(myLibrarySprite);

I've been using essentially this code (plus a bit for say drawing a square) happily to gradient fill sprites that are dynamically drawn. I don't get any errors from this.
I have tried adding myLibrarySprite.graphics.clear() but that does not make a difference.

View 3 Replies

ActionScript 3.0 :: Flash Sprite Gradient Mask AS3

Sep 10, 2010

I have created a Sprite that contains 3 movieclips that act as masks for another movieclip. 2 of the moviclips have an alpha gradient but I cannot get the alpha to work. I have the three masks because they are separately animated.Here is my code.

var maskContainer = new Sprite();
maskContainer.addChild(WebPageMaskEndT_mc);
maskContainer.addChild(WebPageMaskEndB_mc);[code]....

NOTE: I have also tried setting cacheAsBitmap for the 3 individual masks but no results.

View 2 Replies

Actionscript 3 :: Accessing The Gradient Of A Rectangle Created In The Flash Editor?

Jan 7, 2011

I need to export the gradient settings of a rectangle created with the Flash editor. Our artist creates a rectangle with the gradient in a .fla. Is it possible to retrieve the gradient parameters from the .swf or from a flash plugin I could write?

View 3 Replies

Flex :: Apply A Dynamically Created Gradient Mask On A Textfield?

Jun 9, 2009

Is it possible to apply a dynamically created gradient mask on a textfield in flex?

View 2 Replies

ActionScript 3.0 :: Gradient Mask On 2 Background?

Nov 13, 2011

In a project, I've got 2 background (one light and one dark). My main background is the dark one and when I move my mouse I wanna show in a small circle with an alpha gradient the light one.

But I don't know how can I do that...

I try and I've got white mask with the light background in my circle or I've just got the dark background and no mask.

If someone already do that and can explain it to me ?

View 1 Replies

ActionScript 3.0 :: Animating Gradient Background?

Sep 2, 2009

Sometime ago i ran into some url where they had a code for animating your background. Does someone have an idea how to do it or where to find it.

View 6 Replies

ActionScript 2.0 :: Make A Smooth Gradient Background?

Aug 26, 2009

Hi, I can't figure out how to make a smooth gradient background.I've been searching the forums, but can't figure it out.

View 5 Replies

Flash 9 :: Create A New Background As Vertical Gradient?

Aug 8, 2008

i am trying create a new background as vertical gradient. but i can not find such a option. only horizontal gradient in Flash CS3 ?

View 1 Replies

Flex :: A VBox With Only One Rounded Corner And Gradient Background

Oct 5, 2009

I'm working with Flex 3.4 SDK.

I'm trying to programmatically(yep, must be this way) style/skin a VBox so that its top right corner is rounded, and it gets a two colors gradient brackground.

Modifying examples I found around I was able to accomplish both effects(corner and background) but only separately:

VBox with not all rounded corners: [URL]

VBox with gradient background: [URL]

But what I need to do is to apply both at the same time. And all my coding attempts so far have failed silently.

View 2 Replies

Flex :: Set The Gradient Background Color For Panel Via Skins?

Jun 10, 2010

I am trying to set the gradient background color for my panel via skins. I try to change my code but nothing seems to change. Not sure what to do.

My skin file

/<!-- layer 2: background fill --/>
<!--- Defines the appearance of the PanelSkin class's background. -->
<s:Rect id="background" left="1" top="1" right="1" bottom="1">

[Code]....

View 3 Replies

Flex :: Set A Gradient Background For The Selected Item In AdvancedDataGrid

Mar 4, 2011

I want to set a gradient background for the selected item in my AdvancedDataGrid

View 1 Replies

ActionScript 2.0 :: Circle Gradient Over The Background (fullscreen / Autoresize)

Jul 29, 2009

I'm working on a fullscreen flash project. I've got everything working fine, background tile, autocenter, etc one thing I can't find out is how to have a circle gradient over the background (fullscreen / autoresize) [URL]

View 1 Replies

ActionScript 2.0 :: Website With Gradient Full Screen Background?

Jan 14, 2009

I have a website already done... but I'd like it to be over a full screen gradient background.I found a lot of tutorials and exemple on how to repeat a symbol picture to make a seamless background just like the one Lee Brimelow made on gotoandlearn.com, but I can't find one on how to make that gradient full screen background.

View 6 Replies

ActionScript 3.0 :: Fill Dynamically Created Sprite?

Sep 21, 2009

I'd like to fill the .graphics section of a sprite AFTER a series of lines and arcs are drawn. To draw the shape, I need to use a series of moveTo() and lineTo() statements, so the standard beginFill() won't work for me. The final shape will always be closed, but I don't have the lines/arcs in sequential order.

View 7 Replies

Actionscript 3 :: Created External As Files That Extended A Class Such As Sprite?

Jun 11, 2010

i've only ever created external .as files that extended a class such as sprite. now i just want to create one that doesn't extend anything and call it from a frame script.

[Code]...

View 1 Replies

ActionScript 3.0 :: Masking A Movie Clip Using Dynamically Created Sprite?

Feb 10, 2010

I just tried to use a sprite mask another movie clip .But it doesn't workis there any way to try thishere is my code

ActionScript Code:
sp = new Sprite();
addChild(sp);

[code]....

View 2 Replies

Flash :: Create A Vertical Color Gradient (or Any Other Angle Besides A Flat Horizontal Gradient)?

Mar 2, 2010

my first time trying to draw a multi-color gradient in actionscript 3. So I got this code from the help docs, but I can't seem to get a vertical gradient, whatever formula or number I use for rotate, it stays stuck on the default horizontal gradient :(

[Code]...

View 3 Replies

ActionScript 3.0 :: Print The Content Of A Sprite Without The Background?

Oct 28, 2009

How can I only print the content of a sprite (here a simple text) without the background color of the document?

View 4 Replies

Professional :: Created, Than Dropped On The Background Image?

Sep 19, 2011

I am wanting to allow icons/small images dragged and drop on the background photo. Is this possible? If so, can you point me in the direction to look?

I want to create my own little icons/images and allow someone on the web to drag and drop an image I created, than dropped on the background image.

View 3 Replies

Actionscript 3 :: Class Extending Sprite - Set The Sprite's Width And Height Properties?

Mar 5, 2010

I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.

What the heck is going on? When I view the livedocs I see that DisplayObject has width and height listed as public properties. I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.

package {
import flash.display.*;
public class ScrollBar extends Sprite {[code].....

View 1 Replies

Flash: `sprite.visible = False` Doesn't Hide Sprite Immediately?

Apr 4, 2011

I've got a sprite which I want to temporarily hide... But changing the .visible property doesn't do what I expect. The code looks roughly like this:

[Code]...

View 1 Replies

IDE :: Adding A Single Sprite On Main Moviclip Sprite Remains Invisible

Mar 2, 2009

I created a new AS3 document (550px by 400px) and added the following code to the first frame.

However, when I run this, I see nothing painted on the screen at all, the screen remains completely white.[code]...

View 3 Replies

Flash :: Rotating Sprite Moves The Sprite From It's Original Location

Jul 6, 2011

I'm doing a simple rotation on a sprite but there's a weird behavior where the sprite does not rotate around it's top left. I think I'm rotating along the top left of the test class instead of the sprite child. I would like to rotate the rectangle around it's top left corner (kinda like a clock hand). The code is pretty short so I'll let the code + pictures explain my problem:

package
{
import flash.display.Sprite;

[Code]....

I've read a lot of stuff about rotating around a fixed point, I've tried doing it with movieclips instead of sprites, I even copy pasted a tutorial on rotation and nothing works.

View 3 Replies

ActionScript 3.0 :: Sprite.addChild(NumericStepper) Resizes Sprite To 100x100

May 27, 2008

[Code]...

Then the numericStepper is drawn as if it is squished to 20% its normal height. If I pre-set mySprite width and height before adding the numericstepper, the trace output is 0,0 after adding it and it is not displayed at all. Is there some way I can make the sprite only adjust to correctly fit the numericStepper OR resize it afterwards without distorting the numericStepper component?

View 2 Replies

Actionscript 3 :: Difference Between Sprite.width VS Sprite.scaleX?

Sep 23, 2011

Both of sprite.width and sprite.scaleX can be used for scale a sprite. Is possible sprite.scaleX depends on screen size?

View 2 Replies

ActionScript 3.0 :: Sprite.graphics And Setting Sprite.width?

Jun 19, 2009

It has been a great resource of the years. No my problem. I am trying to dynamically resize a sprite that has a line drawn into it. Here is my code:

[Code]...

View 4 Replies

ActionScript 3.0 :: Mcproduct Sprite And Mcproductpane Sprite?

Aug 15, 2010

first i have 2 sprite.. it`s mcproduct sprite and mcproductpane sprite . mcproductpane is a parent of mcproduct sprite.. so inside mcproductpane there a several mcproduct sprite.this is a script of mc prodcut

PHP Code:

[Code]...

The problem is i want to set a button in here(mcproductpane sprite), this button will unload / make dissappear an image that i load using loader class in mcproduct sprite..how can i make this happen?when i want to make a button in mcproductpane sprite which the function of the button it`s to unload/make an image that i load using loader class in mcproduct sprite disappear.

View 1 Replies

ActionScript 3.0 :: System Resource Use - Flash Created Vs Photoshop Created?

Mar 14, 2009

I have only one question but phrased it 3 ways:

1) Is it better to pre=render things say in photoshop or have flash render them?

2) if I have a field of stars that drift along; is it better to create that Star Field in photoshop as a single picture (say a .png) or to create a star in my library and add it to a movie clip and then have that drift along?

Lets say I have a blur effect on my stars and have an equivalent on the photoshop.

3) I have heard (and experienced) adding effects like blur takes a fair amount of CPU and memory so was wondering if I created the effect in photoshop and then imported the 'blurred' object into my flash if I could cut down on system resources?

View 2 Replies







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