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




Button "pixelates" When I Change Its Width?



Hello there.

I have a voting page fully made in flash, with -surprisingly- a "Vote" button.

When the button is clicked, it will do "vote_button.enabled = false;" and it will change its label from "Vote" to "You have already voted", appart from other changes, so that someone who has just voted, can't vote again straight away.

Obviously, the latter text is longer than the original "Vote" one, so I need to resize the button accordingly through code (I assume there's no way of making the button automatically resize itself to fit its label?).

I've tried both:


Code:
vote_button._width = XX;
and:


Code:
vote_button._xscale = XX;
However, no matter which one I use, the effect is the same: the button is just "scaled" like a bitmap image, which results in it looking bad, pixelated, etc. I really like my sites to look neat and clean, so I'm desperately looking for a way of making the button actually change its width property so that it redraws itself accordingly, rather than just getting stretched in such a cheap way, lol.

Does anyone know how to do this?



FlashKit > Flash Help > Flash General Help
Posted on: 01-16-2008, 07:36 AM


View Complete Forum Thread with Replies

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

Button Properties Width And Height Etc. Change
Button properties width and height etc. change

I am working with several movie clips on different layers.

Each movieclip has a number of layers itself.

Sometimes when i set the properties width and height etc. of a button, say, to 320 and 50 i find that later it is changed to 318.3 and 50.9

This is really irritating because i am trying to get parts of the different layers to overlap (i'm using swapdepths) and want the overlap to be precise and not slightly move.

Is there a way to prevent this happening?

Button Properties Width And Height Etc. Change
Button properties width and height etc. change

I am working with several movie clips on different layers.

Each movieclip has a number of layers itself.

Sometimes when i set the properties width and height etc. of a button, say, to 320 and 50 i find that later it is changed to 318.3 and 50.9

This is really irritating because i am trying to get parts of the different layers to overlap (i'm using swapdepths) and want the overlap to be precise and not slightly move.

Is there a way to prevent this happening?

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

Png Image Pixelates ?
when you import a png into flash. it looks perfect till I animated so it rotates then it looks jagged/pixelated during the rotation. Is the only way to fix this, to actually export the png from photoshop, as each individual frame and change rotation on each one before exporting ?

Video Pixelates
I'm using Flash MX 2004. I've imported a video clip that I want to use but the video looses all of it's quality when I import it. It gets very "pixely" (ok so that's not a real word but you know what I mean.)

I've tried using an mpeg as well as a wmv file. What can I do to get the clear picture back?

Movie Clip With Filter Totally Pixelates The Vector So You Can't Make It Out
After a little investigating I learned that making my vector object a "movie clip" symbol rather than a "Graphic" symbol will give me the opportunity to use filters (ie drop shadow, glow, etc.). However, when I use the filter my vector object pixelates severely. If I apply any one of the filters they make my vector symbol so blurry you can't even make it out. Are they rasterizing? Am I missing something? Help.





























Edited: 12/09/2008 at 10:40:15 AM by Sufi Girl

How Can I Change The Width Of Textbox.
I Have a dynamic textbox in my movie. Can I change the width of the textbox depending on the size of text that will come in that textbox.

Please let me know ASAP as this is very critical for me.

thanx

Rits

Dynamically Change Width
I have a "power bar" in a game I'm creating, that diminishes every time you press the space bar.

Im currently using the following code to decrease the bar when the space bar is pressed:


Code:
if (Key.isDown(Key.SPACE)) {
_root.mc_bar._width -= 2;
}
This is working fine, except that the bars width is being decreased from the centre, whereas I only want it to "shrink" from one side. I have moved the registration point to one side of the bar but it had no effect.

Any help would be most appreciated.

Change Stage Width In AS3
Ok so In AS2 I could change the Stage width with code like this:

Stage.width = 1000; (usually to match different resolutions for certain projects I used some code here to get current resolution of screen and make the stage same width minus a few more pixels cuz of the scroolbar)

Now.. I see that i must type a code like this:
stage.stageWidth = 1000;

The problem is that this value is not writable no matter it says so in the flash help. So I can't change it :(

Can anyone tell me how I can change the stage width using AS3 please ?

Flame

Change Width & Height
I've got a mc which I've put this code onto:

Code:
onClipEvent(enterFrame) {
var acceleration = 0.8;
nuw = this._width;
nuh = this._height;
if (this._width < 50 && this._height < 80) {
nuw = this._width;
nuh = this._height;

this._width = nuw + (3 * acceleration);
this._height = nuh + (4 * acceleration);
}
}
This makes the mc bigger. How should I do to make it shrink back to normal size again??

Trying To Change Width Of Mc With Actionscript...
Hello, noob here, not so experienced with AS, this is what I'm trying to do:

I have a rectangular movieclip, it expands and contracts (just the width) and fades from one color to another when a user clicks on any of the menu choices.

In order to avoid having to map out the animation for all of this in frames, I'd just like to do it once in code and change the parameters. So, I've already figured out how to fade the color of the mc, and now I'm trying to figure out how to change the width - I tried this:

onEnterFrame = function(){
mc._width += 4;
etc...

but the width expands on both sides, I just want one side of the mc to move, and the other side to stay at its current x, y. Also, can't figure out how to make it stop expanding, I know it should be something like:

desiredWidth = 400;
if (mc.width != desiredWidth) {
mc._width += 4;
} else {
exit_loop
}

but I don't know the correct syntax for this...

any ideas? thanks!!!

Change Combobox Width
How do I change the width of a dynamically attached Combobox?


PHP Code:





function comboBoxInitialize():Void {
    var cb_Initialization = {data:[],editable:false,labels:[],rowCount:5, restrict:"",enabled:true,visible:true,minHeight:0,minWidth:200};
    _root.attachMovie("ComboBox", "cb_videoCategorie", this.getNextHighestDepth(), cb_Initialization);








Thanx!

Change SWF Width And Height With Actionscript? Is It Possible?
Hi everyone, I have an animation with 100 or so frames, and its very large. I have to resize it for someone, and I dont want to do it the long and tedious way (aka resizing each frame, or putting it in a movie clip and resizing that, etc.).


Ive been trying to resize the swf by actionscript with no luck (I have FlashMX btw, in case theres specific MX only code that I can use).

This is what I have but it doesnt work when I load the .swf.


Code:
movieWidth = Stage.width;
movieWidth = 100;



I also tried


Code:
movieWidth = _root._width;
movieWidth = 100;


But that doesnt work either. Any help is greatly appreciated! Thanks

The Scrollbar Component Is Too Fat Can I Change The Width?
i tried just doing the
scrollbar.width = whatever

but then it changed the perportions and the buttons arent square anymore.


is there a way to change the width so it still looks right, or am i stuck with a fat scrollbar?

[CS3] Change Width Of Scrollbar In ComboBox
Hi,

Is it possible to change the width of the scrollbar in a ComboBox? The default size is too small for use with a touchscreen.

Thanks.

Can't Change The Width/height Of A Sprite
Hi,

I have a very simple question that is confusing me. I create a new sprite object, and attempt to set its width and height as such:

var P:Sprite = new Sprite();
addChild(P);

P.x = 100;
P.y = 100;
P.width = 20;
P.height = 20;

trace (P.x + " " + P.y + " " + P.width + " " + P.height);

The trace returns the following: 100 100 0 0

This means that the width and height are 0. Am I missing something? How can I get it to register the change in width and height to 20?

Thanks very much.
Cheers.

Screen Resolution. Change Width. HELP
I want to change width of the movieclip depending on the user screen resolution.
But, when I set Stage.scaleMode = "showAll" or set in width=100% in HTML code I've got center align movieclip and the outside objects. But, I need possibility to create movieclip which started at 0,0 position and have width parameter depending on the user screen resolution, without LEFT development space with outside objects. How can I do this? Please, help me.

Movieclip Stops After Width Change
Hi,

It's not my first time with flash, but it's with AS3. I'm having a problem and i don't get it. I'm working with Flash CS3 PRO.

The thing is that i'm working in AS3 with a movieclip. That movieclip has more nested movieclips within. So I've:
+ bicycle_01
++ body_low

body_low is animated in bicycle_01. I've created a class that will manage my characters. (This is for a cyclist ranking). So within my main file I create the cyclist. I haven't even started and i found the first problem, i'm trying to change the width of body_low but it freezes. After i change the width of body_low, bicycle_01 stops playing.

Here is my problem: _cyclist.getChildByName( "body_low" ).width = 10;

If I add this line body_low width changes, but the animation stops. (right movieclip in this example)

Any idea?
Thanks. :)

pd: Here is the fla and the two .as files: http://www.illarra.com/_lab/Follow-Flash/001.zip







Attach Code

/*
MAIN FILE
*/

package
{
import flash.display.Sprite;
import flash.events.*;
import flash.utils.Timer;

public class FollowFlash extends Sprite
{
protected var _cyclist:Cyclist;

public function FollowFlash()
{
_cyclist = new Cyclist();
_cyclist.setBicycle( 1 );
_cyclist.setPos( stage.stageWidth / 2, stage.stageHeight / 2 );
addChild( _cyclist );

_cyclist = new Cyclist();
_cyclist.setBicycle( 2 );
_cyclist.setPos( stage.stageWidth / 2 + 30, stage.stageHeight / 2 );
addChild( _cyclist );
}
}
}

/*
Cyclist Class
*/

package
{
import flash.display.MovieClip;

public class Cyclist extends MovieClip
{
// ...
public function setBicycle( bicycle:int )
{
_bicycle = bicycle;
_cyclist = new bicycle_01();

if( bicycle == 2 )
{
_cyclist.getChildByName( "body_low" ).width = 10;
}
addChild( _cyclist );
}
// ...
}
}

























Edited: 11/04/2008 at 12:55:27 PM by aillarra

How Do You Change Movie Width And Height
How do you change movie width and height using actionscript????????????????????????????????????
(Without changing the size of everything else.)

Preloader - Change Progress Bar Width
hi there

i'm using the following preload code, courtesy of kirupa :

http://www.kirupa.com/developer/mx/p...epreloader.htm

I can't seem to get the progress bar width (or height) to change.

any ideas?

thanks
aidan

How To Change Bitmap Width And Height
Hi,

sry, for this stupid question, but I cannot way to do this.

I have get Bitmap from Loader.content, and want to change its width and height properties.
How is this possible?

How To Change The MovieClip Height And Width
I use FlashMX 2004. I need to know how to change the width and height of the MovieClip when it loads to the stage. I used the following method

instanceName._height=value
instanceName._width=value

but when I do like this movie does not load. when I do this method to vary x and y position of the movie it works.

How Do You Change Movie Width And Height
How do you change movie width and height using actionscript????????????????????????????????????
(Without changing the size of everything else.)

AS3 - Change MovieClip Width With JS Variable
I want to be able to change the width of a MovieClip via a variable set in JavaScript. I've been reading about the ExternalInterface class, but all of the examples I've tried failed.

Change Stage Width Problem
Ok so In AS2 I could change the Stage width with code like this:

Stage.width = 1000; (usually to match different resolutions for certain projects I used some code here to get current resolution of screen and make the stage same width minus a few more pixels cuz of the scroolbar)

Now.. I see that i must type a code like this:
stage.stageWidth = 1000;

The problem is that this value is not writable no matter it says so in the flash help. So I can't change it

Can anyone tell me how I can change the stage width using AS3 please ?

Flame

Scrollpane - Change Scroller Width
Hi ppl,

today I am trying to change the color of the scroller on my scrollpane. Look..
Code:

createClassObject(mx.containers.ScrollPane, "sp", this.getNextHighestDepth());
sp.setStyle("borderColor", "0x000000");



the code above works fine but for one slight problem. A white border flashes up on my scrollpane then disappears. But the main issue is that the code for changing the scroll track color doesnt work:

Code:

sp.setStyle("scrollTrackColor","0x999999");



Why is this? Does any one know how I can change the color of the scroll track. Thanks

To Change Width Of Clips In Continuous Manner
Hi,

I have a movie clip on my main timeline. i duplicate it several times to get many copies. I want to change the width of each of the instances. the widths vary..If i do a setProperty for each its changes it suddenly to that much. But I want a tweening motion to change the width from 1 to the width required for each such instance.
How to do it?? Any help!!

thanks

What Is The Best Way To Change The Width Of The Scrollpane Gutter And Arrows?
Has anyone done this? Do I manipulate the width via the code or by editing the assets themselves?
ta - m

How Change The Width And Height Of Loaded Movie?
Hello guys.
I want to load some .swfs into my main movie(by loadMovie).
but they are not same size.
how can I resize them to a specific width and height?
(constraint is never mind)

Change Height And Width Independently - It Just Scales
Hi
I have a clip called object whose height and width i want to change independently - but it just scales up and down - when the height and width are increasing it scales up fast but when the height is increasing and the width is decreasing it scales up slowly. If i stop one of the intervals (either the height or the width) it still scales both the height and the width at the same time - here's my code :
PHP Code:



object._width=500;
object._height=275;

var maxWidth=700;
var minWidth=150;
var maxHeight=650;
var minHeight=50;

direction="w";
heightDirection="u";


function stretchHeight(){    
    if(heightDirection=="u"){
        if(object._height>=maxHeight){
            heightDirection="d";
        }else{
            trace("height up");
            object._height += 5;
        }
    }else{
        if(object._height<=minHeight){
            heightDirection="u";
        }else{
            trace("height down");
            object._height -= 5;    
        }
    }
}

function stretchWidth(){
    if(direction=="n"){
        if(object._width<=minWidth){
            direction="w";
        }else{
            trace("width down");
            object._width -= 5;    
        }
    }else{
        if(object._width>=maxWidth){
            direction="n";
        }else{
            trace("width up");
            object._width += 5;
        }
    }
}

var heightInterval = setInterval(stretchHeight, 10);
var widthInterval = setInterval(stretchWidth, 10);
stop();




Is it a logic problem with the code or something else ??
Thanks for any help
:-)

[CS3] Change Width Of Scrollbar In ScrollPane Component
Hi I'm using the scrollPane component in my flash movie to display some text. Is there any way of increasing the width of the actual scrollbar itself? It's appearing quite thin on the screen.

Any help is appreciated! Thanks very much!

Change Width Of Attached Movie Problem
Hi,

I can't control the width (or height) of my attached button. This is what I'm doing:


ActionScript Code:
myBtn = _root.myMC_mc.attachMovie("btnArea", "buttonName", 102);
with (myBtn) {
    _y =yPos;
    _x = xPos;
    _width = 20; // I can put whatever I want here and it doesn't matter
    _height = 40; // I can put whatever I want here and it doesn't matter
    onPress = function() {
        trace("click");
    }; 
}

Positioning and the onPress-function works fine. btnArea with the original width of 10 pixels is imported from the library and I've used several times before in this movie (without problem). The new button width is set to about 100...

Hope you can figure out what I'm doing wrong...

Change Stage Width Based On Flashvar
Is there any way to change the Stage width based on a flash var. Basically I have a spot that needs the same flash content but depending on the page it needs to be one of two widths, and I would like to use only one movie if possible.

Thanks
Greg

Can I Change The Stage Height And Width With Actionscript?
can i change the stage height and width with actionscript?

Checking If File Exists / Change Width & Height
Hi,
I'm trying to return the width of a dynamically placed image. I've created a holder, but for some reason when I do a trace(holder._width); it just returns 0. Here is the script I am using - it checks to see if a file exists then loads the next image when the user pushes the next_btn. If the file doen't exist, nothing happens. My problem now is changing the registration point and setting its size, but I can't seem to return the width of the movie clip. Perhaps it has something to do with the holder path. Thanks in advance for your help.

code:
var fileExists:LoadVars = new LoadVars();
fileExists._parent = this;
fileExists.onLoad = function(success){
if(success){
var slides:MovieClip = this._parent.createEmptyMovieClip("slides_mc",1);
var holder = this._parent.slides_mc.createEmptyMovieClip("holde r_mc",1);
holder.loadMovie(person + "/" + folder + "/" + "image" + imagenum + ".jpg");
holder._x = regpoint_mc._x;
holder._y = regpoint_mc._y;
trace (holder._width);
}else{
imagenum--;
}
}

fileExists.load(person + "/" + folder + "/" + "image" + imagenum + ".jpg");

next_btn.onRelease = function (){
imagenum++;
fileExists.load(person + "/" + folder + "/" + "image" + imagenum + ".jpg");
}

How To Change The Width And Height Of An Image Loaded In A Movieclip
Hi

I would like to know how I can modify the size properties of an image that is loaded in a movie clip with Loader()
In my example, if I change the width and height properties of the movieclip in which the image is loaded, the image can't be seen anymore
If I don't modify the width and height properties, then the image can be seen
What should I modify in my code so that I can change the size properties and still have my image on the scene?

Here is my code
Code:
var imgLoader:Loader = new Loader();

var image:URLRequest = new URLRequest('model.jpg');

var imgDisplay:MovieClip = new MovieClip();
imgLoader.load(image);
imgDisplay.addChild(imgLoader);

// if I change width or height,
// the image can't be seen, why?
imgDisplay.width = 50;
imgDisplay.height = 50;

addChild(imgDisplay);
many thanks for your help

How To Change The Width And Height Of An Image Loaded In A Movieclip
Hi

I would like to know how I can modify the size properties of an image that is loaded in a movie clip with Loader()
In my example, if I change the width and height properties of the movieclip in which the image is loaded, the image can't be seen anymore
If I don't modify the width and height properties, then the image can be seen
What should I modify in my code so that I can change the size properties and still have my image on the scene?

Here is my code
Code:
var imgLoader:Loader = new Loader();

var image:URLRequest = new URLRequest('model.jpg');

var imgDisplay:MovieClip = new MovieClip();
imgLoader.load(image);
imgDisplay.addChild(imgLoader);

// if I change width or height,
// the image can't be seen, why?
imgDisplay.width = 50;
imgDisplay.height = 50;

addChild(imgDisplay);
many thanks for your help

How To Change Height And Width Of Images Loaded Into Movieclips?
Hi,

I've loaded images dynamically into movieclips using .loadMovie();

I need to adjust the height and width of the images after they are loaded, does anyone know the syntax for this?

The images being loaded are 40x40px in dimension, but I want them to display at 20x20px.

I thought I could just do this, but no dice:
menuitem.mc_menuimage._height = 20;
menuitem.mc_menuimage._width = 20;

How To Change The Width And Height Of An Image Loaded In A Movieclip
Hi

I would like to know how I can modify the size properties of an image that is loaded in a movie clip with Loader()
In my example, if I change the width and height properties of the movieclip in which the image is loaded, the image can't be seen anymore
If I don't modify the width and height properties, then the image can be seen
What should I modify in my code so that I can change the size properties and still have my image on the scene?

Here is my code
Code:
var imgLoader:Loader = new Loader();

var image:URLRequest = new URLRequest('model.jpg');

var imgDisplay:MovieClip = new MovieClip();
imgLoader.load(image);
imgDisplay.addChild(imgLoader);

// if I change width or height,
// the image can't be seen, why?
imgDisplay.width = 50;
imgDisplay.height = 50;

addChild(imgDisplay);
many thanks for your help

Change Width Of Duplicated Clips,setProperty Doesnt Work?
In my movie file i have a "bar" movie clip that is an
instance of "rect" movie clip..I want one bar for each
record of my database table. So i do duplicateMovieClip()

In the frame 3, main timeline where i have code for
duplicating i do a setProperty(_xscale ) to what i get
from the database. this val can be anything between 0
to 100.
I want the individual duplicated bars (bar1, bar2..)
to be as wide depending on what i set _xscale of each
bar..to.. Just setProperty in the main timeline code
doesn't work..i tried alll sorts of things in the clip
too,but no way..
My "rect" movieclip as such is of only width 1...it
remains one when I play it.

I also wanted it to change as a tween from 1 to whatever i set _xscale to...

Thankyou,
shilps.

When I Change The Width Of A Parent Sprite, The Child TextField Wont Display
Hey,
Ive got a problem that is driving me insane. I have a parent class which extends sprite, and within it I create a TextField object and add this as a child to the parent. The TextField object displays correctly if I dont change the parents width using this.width. As soon as I assign a value to the parents width, the text will not render. Any ideas?

-------- Code ---------

package
{
import flash.display.*;
import flash.text.*;

public class main extends MovieClip
{
public function main()
{
var p:Parent = new Parent();
addChild(p);
p.createchild();
}
}
}

-------

package
{
import flash.display.*;
import flash.text.*;

public class Parent extends Sprite
{
public function Parent()
{
this.width = 300; // PROBLEM POINT!!
}

public function createchild()
{
var GC:TextField = new TextField();
GC.x = 10;
GC.y = 10;
GC.text = "text";
GC.width = 50;
GC.height = 20;

this.addChild(GC);

}
}
}

-------

Thanks for any help.
Cheers.

Change Width - Height In Flash Movie According To Html Window Size
I know how to change the flash movie to fit all screen in the browser window using WIDTH="100%" and HEIGHT="100%"

But! How to make it like this side: http://www.ego7.com/

In that site the width and height is 100% but the content in the flash movie is the same width all the time. The only thing that changes is the background of the flashmovie. The background is getting scaled in height, how is this possible?

When i try to do this it scales my whole movie.

When I Change The Width Of A Parent Sprite, The Child TextField Wont Display
Hey,
Ive got a problem that is driving me insane. I have a parent class which extends sprite, and within it I create a TextField object and add this as a child to the parent. The TextField object displays correctly if I dont change the parents width using this.width. As soon as I assign a value to the parents width, the text will not render. Any ideas?

-------- Code ---------

package
{
import flash.display.*;
import flash.text.*;

public class main extends MovieClip
{
public function main()
{
var parent = new Parent();
addChild(p);
p.createchild();
}
}
}

-------

package
{
import flash.display.*;
import flash.text.*;

public class Parent extends Sprite
{
public function Parent()
{
this.width = 300; // PROBLEM POINT!!
}

public function createchild()
{
var GC:TextField = new TextField();
GC.x = 10;
GC.y = 10;
GC.text = "text";
GC.width = 50;
GC.height = 20;

this.addChild(GC);

}
}
}

-------

Thanks for any help.
Cheers.

Constrain Objects To Fall Within The Width Of Canvas, Change Opacity As Object Falls.
First time using Flash and I'm trying to modify a tutorial I found on this site. Bear with me if this stuff is too much of a noob question =T.

I'm using this tutorial: http://www.flashkit.com/tutorials/Ac...-980/index.php and changing it so that there are leaves instead of snow falling. So far I have this: http://dcdomain.org/images/taro/left.swf There are a few things I would like to modify though.

1) Some of the leaves are falling outside of the right margin, is there a way for me to put in a constraint that would force the leaves to stay within the canvas parameters, either not allow leaves to fall that far to the right, or have them bounce back to the left when it hits the right margin.

2) I would like to get the leaves to fade out as it falls, so when it reaches the bottom, they should have an opacity of around 0 to 10. What are the steps I should do, or the actionscript I should add to get this effect?

Existing Code:
Frame1:

PHP Code:



shape = Random(4) + 1;
flakey.gotoAndStop(shape);
fallwidth = 300;
flakey._x = Math.random() * fallwidth;
flakey._y = 0;
fallheight = 550;
magnify = Math.random();
flakey._xscale = (magnify * 75) + 25;
flakey._yscale = (magnify * 75) + 25;
step = (magnify * magnify * 2) + 3;
drift = (Math.random() * 4) - 2;
spin = (Math.random() * 6) - 3;
flakey._y = Math.random() * fallheight;
gotoAndPlay(3);




Frame2:

PHP Code:



shape = Random(4) + 1;
flakey.gotoAndStop(shape);
fallwidth = 300;
flakey._x = Math.random() * fallwidth;
flakey._y = 0;
fallheight = 550;
magnify = Math.random();
flakey._xscale = (magnify * 75) + 25;
flakey._yscale = (magnify * 75) + 25;
step = (magnify * magnify * 2) + 3;
drift = (Math.random() * 4) - 2;
spin = (Math.random() * 6) - 3;




Frame4:

PHP Code:



flakeyfall = flakey._y;
if ((flakeyfall <= fallheight) && (flakeydrift>= -35) && (flakeydrift <=  fallwidth+35)) {
flakey._y = flakey._y + step;
flakey._x = flakey._x + drift;
flakey._rotation = flakey._rotation + spin;
gotoAndPlay(3);
} else {
gotoAndPlay(2);
}




One of my friends tried helping by providing me with this:

PHP Code:



//on frame 1

this.onEnterFrame = function(){

if(leafClip._x<rightboundary && leafClip._x>leftboundary){

//this is the function to make leaves fall
leafFalling()

}
}

//leaffalling function

leafFalling = function(){
//initialize alpha for leaves
leafClip._alpha = 100
//then your random falling actions go here
}

-to make the leaves fade with actionscript:
//first make them start fading at a certain y-position
this.onEnterFrame = function(){
if(leafClip._y<400){
leafClip._alpha += (0-leafClip._alpha)*.5
}
}




I tried messing around with the code he provided, inserting it into spots within the code I thought would work... obviously I had no luck.

I was able to get the leaves to change opacity, but only once and I guess the alpha stays at 0 afterwards, I tried adding the line where they return to 100% opacity afterwards, but that didn't work.

Any help would be appreciated. Thank you!

How To Change Stacking Of Buttons (or How To Change Play To Pause Button)?
My problem is I want to have one button for play and pause music playing in Flash.

Music starts automaticaly, so Pause button is visible. When user presses Pause button, I want to show him Play button on the top of Pause button.

Shortly: Music is playing = visible Pause button
Music is paused = visible Play button

Is anywhere tutorial or explanation.

THX very much for hints

Jan

Button Change Color On Select, Then Change Back
I have 3 buttons, named but,but2,but3. What I want is if you click a button it changes color to show what page your on. But when you click a different button now that one is highlighted and the original one goes back to the original color. Here's the code.
but3.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner3.swf", "container");
container._x = 0;
container._y = 0 ;

I figure I have to add some kind of if statement?
}

Calculating The Width Of A Button
I am creating a navigational menu using menu item names loaded from an array. I only want each button to be the length of the menu item name. I then want to be able to calculate the exact width of the button.

For example, I can calculate the width of the button based on the number of characters in the name of the menu item, but the width will vary slightly depending on the characters used.

Any suggestions?

Cheers,
Shiny

I Want To Change Button Into MC --> Actions Change Too?
Hi there,

Maybe this is very easy but I am just this NOOB!

OK, problem: I have a button that loads a movie into a contentclip.

This action in the script on a frame on the timeline not the button itself:

but1.onRelease = function() {
_root.box.gotoAndPlay(2);
_root.targetx = _root.but1._x;
window._alpha = 100;
window.widthNew = 390;
window.heightNew = 200;
window.xposNew = 14;
window.yposNew = 120;
loadMovie("aboutus.swf", "window.screen");
};

My desire is the make a more 'moving and actionlike' button (fade in and out and so on). So the button 'area' will be in a MC. How to call that action so the movie gets loaded!?

The whole fla I am using is a resize window tutorial.

Eric

AS3 - Change Width Of ScrollBar / ScrollPane's Scrollbar
Is there any way to change the width of the AS3 scrollbar component? I've tried changing the width of the skin, but it always snaps to the default width.

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