ActionScript 2.0 :: Increase That Movieclip's Width To 40?
Apr 19, 2007
say I have a movie clip that's 20 by 20. then, with actionscript, i increase that movieclip's width to 40. is there a way to update the scale of the clip so that the movieclip's _xscale represents the new 40 by 20 rectangle rather than the original 20 by 20 box?
i have a mc which seize is height = 150 and width = 2 (like a line). i have a script which rotate this line and increases its length. this works, however i dont know how to keep the width so that it wil remain 2. this is the scrip in as3 :
function rotateMoveClip_u(e:Event) { var target=(center.x);
I am trying to increase a swf file height and width so it can fit better in my screen. I don't want to rework on everything again in my fla file because it's big hassle. (changing background size makes every symbol off). Are there anyway to do it?
I've got 2 dynamic textFields that is feed xml data(String) from external xml file.What I want to achieve is that the text fields width should increase or decrease dynamically according the String that's passed into it.Eg:- if the String contains value "Hello, Hello, Hello, Hello, Hello, Hello".The size of the textfield should increase to fit the entire String value inside it.I've tried using TextFieldAutoSize.CENTER or TextFieldAutoSize.LEFT, but I'm not getting what I want.
I create one line (ex.50px width) and convert it to MovieClip, name is hLine. Then when i Pressing the mouse button, that same time i want to increase the hLine width..
I have a Movieclip on stage with nested movieclips inside. All referenced at 0,0. None of the child movieclips load any dynamic content, animate or have Masked Layers. It does have an input textfield in one of the child MCs. The parent MC shows 280 px width, while it returns 313 px with a .width trace. There is no code that alters the .width value of the parent MC at run-time. And the ParentMC on stage is not scaled (it is at 100% width/height)
how to get a movieclip named "topnav" to resize it's width to match that of the stage. I am trying to resize the width of a top nav bar across a resizable RIA. I have started with the following code but with only partial success:
Code: stage.addEventListener(Event.RESIZE, resizeListener); function resizeListener (e:Event):void { var reg2 = stage.stageWidth / 100;
I am building a site where it has a section that when i mouse over it, a new window with more buttons show up, except when i take my mouse out of the area of the Movieclip that contains those extra buttons, that area disappears
I have a movieclip slider_mc that can be dragged across the screen. There are also lots of small movieclips on the stage that I would like to increase and decrease their size depending on how close the draggable movieclip is to them
i am using a movieclip who has two nested movieclips, the problem i am dealing is that when i try to get the width or height of the parent movieclip it always showing the values of the small nested movieclip, when i draw the movieclip it draw perfect but when i read this values shows that error, what can i do?
I am having some trouble with some Movieclip, whenever I try detecting the MC's width, it always display zero for some reason. On the 2nd frame, the following function will start loading. After the initial turn, I have another condition statement to check whether it should go to another frame or not. If it's staying in this frame, it will load this function again, and the temp_counter will increases.
tel_phrase_holder is just a dynamic textfield I use to display the width only. function tel_load () { tel_holder.removeChildAt(0); var a = new Loader(); tel_holder.addChild(a); a.load(new URLRequest(tel_pic_start[temp_counter - 1])); tel_phrase_holder.text = tel_holder.width.toString();}
I tried putting "tel_phrase_holder.text = tel_holder.width.toString();" at the beginning as well like I did at the following code. It's slightly better, but it's loading the previous picture's width instead of the current picture's width. [Code] .....
setting a rectangle movieclip instance's width to 20 at the very start, before the ENTER_FRAME function is fired, but the width remains 20 throughout. I've tried different methods, here are two examples.Here's a simplified, short example:
Actionscript Code: var rect_mcW:Number = rect_mc.width; //store original widthrect_mc.width = 20; //then set the rectangle's width to 20rect_mc.addEventListener(Event.ENTER_FRAME, growRect);function
[code]....
Ok, so the rect_mc's width remains 20 for each ENTER_FRAME event, even though the event listener function should grow it, but doesn't.One other way I tried was wrapping the 20 width inside a function:
Actionscript Code: // opening statements omitted for brevity//first call to addEventListener:rect_mc.addEventListener(Event.ENTER_FRAME, init_width); //on first
[code]....
this second example yields the same result, the rect_mc width remains 20 even Though I thought the event listener that calls the function that sets it to 20 is removed first thing in the second event listener.
So, I assume it's because the code is read from top, and the code that sets width to 20 gets read and executed over and over. But still, shouldn't the growing part also take place over and over? What I want obviously is to store the original width, but start the animation with a width of 20, but just once.
The task I'm gonna perform should be pretty simple: Inside an object I've created ,which extends MoviClip, I pickup a movieclip that stands on main timeline (root) with the getChildByName() method. Once I picked up the Movieclip I would like to read the width of the movieclip and here comes the problem. The movieclip is composed by two level: A mask level (169px width) and another level with an image of 331px width. When I attempt to get the width of the movieclip it returns the unmasked movieclip width (331px) instead of the maksed size(169px). I also tried with the getBounds() method but it returns the same value.
The movieclip is masked within flash (not through actionscript). A possible solution would be giving a name to the mask inside the movieclip and then perform another getChildByName and read the size of the mask, but this wouldn't be a very clear solution (also because I will have to deploy this to another people not very familiary to flash , so they might forgot to properly name the mask and all this kind of program. The best solution would remain automatically detecte the masked width of the movieclip).
I would like to understand why flash consider the whole Movieclip content width disregard the applied mask.
I'm working in Flash Builder 4.5 in pure Actionscript 3.0
I have a movieclip (swc) , I am doing the following :
_visualItem.bgMiddle.height = 200;
bgMiddle is an independant clip only has a single shape in it. On debugging the height remains the same (2.2) but the width changes to 5111. Haven't been able to track it down.
I am creating a minesweeper copy, and i've bumbed into a problem, which I and a fellow programmer finds quite strange.
My code is set up like this: Initializer.as (Just a temp. initializer.(duh)). This creates a new gameGrid, and passes x and y number of blocks, as well as the size.
GameGrid.as (movieclip) This is the board. This controls the whole game, which are filled with:
Block.as (movieclip) Represents a block. Has a size parameter in its contructor, which are the exact same size as the one in GamGrids contructor. For non-mines, a textfield is added as a child. When a flag is set, the block adds a child:
Flag.as (movieclip) Same size in its contstructor.
In the library (in Flash CS5), every movieclip has the same width (60px).
Now, the problem is that the text, bombs and flags are only in the same size as the blocks when i set the size to '57'. If it's lower than 57, the bombs etc. are even lower. At ~30, they're half the size. At 130, its almost the double.
Here's the classes (with some comments): Initializer
Code: package { import flash.display.DisplayObjectContainer; public class Initializer { private var stg:DisplayObjectContainer;
I need to read two image locations from a file and join it together. For this i used the following code.
[Code]....
With this code I can load two images but I can't adjust the position of the second image with respect to first i.e: iam unable to capture the width of the first image.
I'm making a little photo album in flash, where my pictures are being added in a movie clip. The problem I have is when I add a with and height to my movie clip, I can't see it anymore. It's probably a stupid mistake, but I've been searching for an solution these past days, but I didn't find any.
(when I don't add the width and height, I can see the pictures) Here's a little part of the code.
Code: var mc:MovieClip = new MovieClip(); mc.width=300; mc.height=100;
I need to read two image locations from a file and join it together.For this i used the following code.
Part A:
//this reads from the file images.txt and puts in an array "images" //the size of the array "images" is 2 // m = new LoadVars(); m.onLoad = function(ok) {[code]...........
With this code I can load two images but I can't adjust the position of the second image with respect to first i.e: iam unable to capture the width of the first image.
I need to know how to change the width and the height of the movie clip. I know how to scale x and y but that doesn�t work in my case because i have for example an object which height is 75 pixels and width is 137 pixels. X scale and Y scale would work if my objects were 100 pixels width and 100 pixels height.
I'm doing an image gallery from xml file, and the thumbnails have diferent sizes. Around the thumbnail there is a border, both are diferent movie clips (thumb and border). they reside inside a main movieclip wich is being duplicated.
So I need to resize the border according the new size of the thumb movieclip, but flash actually gets the value from the starting value of the thumb, not the size after the file was load on to it.
I just thought flash would read the new value if i set the var for the width after the load movie, but that ain't happening =(.
My code so far:
Code: function createButton(newObj, thumbNode, bigImageNode){ duplicateMovieClip(thumb_base, newObj, depthCount++); var tempName = eval(newObj);
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)
I'm loading a flash MovieClip (Test.swf) like below. The problem is I can't read the size of mc (mc.width and mc._width both return 0, for the height as well), but I need to scale it. I have the stage size, I can scale, but I don't have the size of Test.swf, so I can't scale it to fit into the stage... ActionScript2, not actionscript3. If it was 3, I could get the value from the loader, but with as2??? The problem is I don't have control over the swf I load, so I can't put it's dimensions in the first frame...
I've a movieclip in my library ready for export to ActionScript. It's width and height is (723, 614.05), but I tried to put it on stage manually and check. When I get the item from library in ActionScript i get that's it's width and height is (743.65, 626.75). How can that be possible?
I know there have been several similar posts but of those I've read, there hasn't been an easy straight forward solution that will work dynamically. The solutions posted have ranged from
super.width = wvalue;
super.height = hvalue;
which I did not get to work, and it seemed from the response to the suggestion neither could the person who originally asked for help, to suggestions about using scale, all the way to having to create an event handler that will get notified after the load, which I guess would work once but wouldn't work dynamically.
Here is the scenario -
I want to change width and height for a MovieClip, but I dont want to scale it, (its more like cropping the MovieClip, not shrinking or stretching) and I want to do this several times not just after the load of the MovieClip.
So my questions are:
1) Is there anyway to do this that really works, that hopefully isn't totally convoluted?
I would like to know how i can get the width of a movieclip on its current frame. I am using scrollRect to hide certain sections of the movieclip and when i want to return it to its original size i need to get the dimensions the movieclip on each frame so i can return it to the default.
I have a frame that plays and checks and prints the width of a movieclip, but the movieclip is constantly changing size, so I would like the textfield to show the movieclip width as is scales. I would assume I need to create a method of looping the code that checks the width, maybe a setinterval?