ActionScript 2.0 :: Setting The _width Of A Movie?
Jul 3, 2003
I am pulling the variable this1length from a text file via loadVariablesNum ("getmy.txt", 0); know that this1length works is a valid variable as I can spit it out elsewhere, but for some reason the statement below is not pulling in the variable to set the width of the MC.P.S. this1length has a value of 10 in my text file.
I have a movie clip that jumps around over the course of my movie using standard keyframe animation. At every keyframe, it calls a function that moves a dynamic text box on top of it, autosizes the text box, then alters the movie clip's _width and _height to fit that of the text box.
The problem is, while the resizing code works fine and the text always fits, the act of altering the _width and _height seems to cancel out the keyframed positioning. The movie clip changes size, but it's forever locked to the position of the first keyframe.
Check it out. I am creating an XML gallery. I am able to load in the gallery info from the XML just fine. The preloader works just fine. And I can set my _x and my _y just fine. BUT.... when I attempt to set my movie clip (that acts as the pic holder) to a width or height, the MC never shows up!
I am creating an XML gallery. I am able to load in the gallery info from the XML just fine. The preloader works just fine. And I can set my _x and my _y just fine.
BUT.... when I attempt to set my movie clip (that acts as the pic holder) to a width or height, the MC never shows up!
ActionScript Code: function firstImage() { if (loaded == filesize) { picture._alpha = 0;
Check it out. I am creating an XML gallery. I am able to load in the gallery info from the XML just fine. The preloader works just fine. And I can set my _x and my _y just fine.BUT.... when I attempt to set my movie clip (that acts as the pic holder) to a width or height, the MC never shows up!
Code: function firstImage() { if (loaded == filesize) {
Basically I've got a movie clip on the stage called loader_mc, I am loading a picture from the server into it with:loader_mc.loadMovie('http:[url]....');I am then trying to to take a snapshot of the image using:
dummyBMP = new flash.display.BitmapData(loader_mc._width, loader_mc._height); dummyBMP.draw(loader_mc); dummyBMP seems to be empty after this though, and I notice that loader_mc._width and loader_mc._height have a value of zero. The picture is visible on the stage despite this though.Anyone know where I'm going wrong?
I'm making some sort of a slideshow, if I load a jpg into a "box", with createEmptyMovieClip, the width of this box is 0. How do I get the width of this box (= width of the picture) and how to resize it with box._width & height.
I am trying to load some thumbnails and I have a few items that seem logical to me, but they do not work. The lines that are commented out do not work for some reason. The width of each thumb is needed so that I can space them out evenly with like 20 pixels between each.Initially photoArray has the path to each jpg, then it is overwritten with the movie clip when they load. If anyone knows why these lines dont work or knows a more efficient manner to load thumbnail jpgs that would be cool.I 've also tried getProperty() with no avail. PEACE - I'M OUT
i loadMovie()'ed a jpeg file into an empty movie clip. after that i traced the width of the cilp and its showing zero.. how is that possible?? i need to get the value of the width of that jpeg picture to adjust its positioning. how do i get it?
I was disappointed to find that I could not use the _width property of a tweened movieclip instance to know how large the mc is at a given time.
Am I just not getting something??
A breakpoint in the onEnterFrame() function shows that _width is always the LARGEST width the movieclip ever has -- not its CURRENT width. In my case the mc is being made larger and larger, using a tween made in the authoring environment. The clip starts out tiny and ends up 400 pixels wide, but the _width property is 400 the entire time!
This does change the width, but the line gets thicker (height is increasing) as the width increases. Why is this happening, and how can I keep it from happening? I want only the length of the line to change, not its thickness.
I'm trying to draw a rectangle with as2 the to strech it's wirdth. It seems to work but something strange is happening while the rectangle is streched it is slwloy lmoving across the scene .
i know it's possible to check the _width and _height of a .FLV with the metadatainfo. BUT not every movie got this kind of info, how do i check this without the info or can i place a .FLV in his original size in the screen?
I'm having trouble getting the _width & _height of a jpeg loaded using loadMovie. I'm trying to reposition it (pseudo-registration point) for rotation in a container movie clip. If I use hard-coded numbers, it works fine. However, if I try to position it based on its _width and _height properties, it's no go... in fact, it doesn't even show up on stage.
I am new for Flash Action Script 2.0 .I have made one script to dynamically load the images depends on the data came from database.This images can be of any size in the directory.I want this images on perticular height and width.so i wrote like UserImage._xscale=35 and UserImage._yscale=47.but i do not get the image of that size.I tried to set _height and _width property the it is not displaying image.so what should i do to get the image of my size?
I'm creating a small docu where you have some control functions like you have in Windows Media Player or Winamp or...
So my problem is that I don't know how I can make the statusbar (a bar where you can see how far the movie is).
I just have a bar that begins with a width of 0 and I want to make a itterative function that just does a _width++ every second/24fps
The question: Is there a function, like the Thread.sleep() method in Java, that let's you wait for a certain amount of milliseconds? Or do I have to put on every frame a call for my ++ function.
Is there a way to detect the _height and _width of a incoming image?
I'm going through a loop, duplicating movie clips with mask, loading an image, and squeezing it down to 100 x 100 for thumbnails. The client wants the thumbnails to be actual proportions but I used so many tweens and setup functions based on the 100 pixel width it's going to be a nightmare.
This is probably just a brainfart but when I publish the code below, my hitTest is triggered by the entire movieclip from 0,0 to _width, _height and not by it�s content. The �fwa� movieclip contains some txt that I broke apart, and I only want the hitTest to run when the �mc� hits the txt within the �fwa� movieclip!
[AS] var i:Number = 0; var count:Number = 0; var colorArr = ["0x99cc33", "0xff0066", "0xffcc00", "0x33ccff"];
I have a bunch of thumb mc instances on my stage, using the same mc symbol. They're all sized differently so the widths(which are same as heights) vary.I want to be able to access their width value from an array independent of all the scaling I'm doing with rollovers. That is, I need to have each mc instance's original width accessible from anywhere in my code.The simplest way to do this is to hard code an array, like:
var Twidth:Array = new Array(); Twidth[0] = "33"; Twidth[1] = "45";[code]....
But since I have 22 thumbs and several portfolios, and want the option of changing their original sizes on the stage, I want to create the array above on the fly using information in a loop. For instance, I already have a loop in a function called generateThumbs(). Here's what I've tried:
for (var i = 0; i<total; i++) { Twidth = new Array(); Twidth[i] = this["thumb_mc"+i]._width;[code]....
for trace on the first method, replacing 'i' with the key I want (Twidth[2]):
undefined undefined 45 undefined undefined
As you can see, this gives me non-indexed non-delimited value for the whole loop (the actual in my real movie is 22). There's no length or array because its actually just one value. Entering a number in the key will display a bunch of undefined with one defined. I have no way of extracting that one key without getting all the other undefined values.my question is: How do I put 'this["thumb_mc"+i]._width' values into a loop with each value indexed for the rest of my functions to access?
i am trying to load array of pictures dynamically in to a loader component,the picture after loading in to loader component i am resizing it to required size. 115 is the width and height of loader component.
.complete = function (eventObject) { loader.redraw(); x_txt1= loader.width; y_txt1= loader.height;
[Code]....
but if i select next picture while fullscreen then loader.width and .height shows as 0 and picture is not displaying.
I'm making a portfolio, it has a large amount of images, one by work, (maybe there are 25) and they are put in a horizontal band, the images all have the same height, but not he same width, and they load an external MC of each work.So I want to create an array storing all this values, _width, and MC to load.
Secondly I have a frame like a stroke of the picture, the frame is in the center of the band of images, and there are two arrows, one to move on the band to the left, and other to the right. The thing is that when I push the arrow the band must move 15 px on left or right, and te frame must adapt (with easing) to the _width of the image.And one more thing, there will be many many images in a future, so I would like that a user if it's holding the left or the right arrow for a medium/long time it could make the band of images to go faster from one to another. I think it's so simple of changing the speed of the movement, what I don`t kwow is how to know if the button is pressed for a long-meidum time.
I have a flash movie, which has two frames and constantly loops. On the first frame I have set my variable, and on the next frame I make it add 1 to that variable. Thing is, the variable is currently being set to "0" on frame one, added one, then set back "0" again as it goes back to the first frame. Is there a way, without adding extra frames to set a variable on Load but then to not set it again?
My actionscript is like this: Frame 1: count = 0 Frame 2: count +=1
how to set flashvars when running a movie in CS4 using Control->Test Movie? Under ActionScript 2 I could just set _root.flashVar, what's the equivalent in AS3?
I created a "movie" that is basically just several sentances fading in and out. I'd like it to stop eventually, so it's not annoying. I know with animated gifs you can tell it to "play" 5 times (or however many times you want). Is there a way to do this in Flash? Or would it be something I set on my html page?
I have my flash website set up with the following structure:
Scene 1: - Menu buttons located in Scene 1 -> navigation_mc - Page 1 (Company page) located in Scene 1 -> companypage_mc - Page 2 (Portfolio) located in Scene 1 -> portfoliopage_mc - etc... a total of 4 pages.
As you can see, I have each function of the website in its own layer and movie clip, so my question is how do I access a movie clip outside of the current movie clip?
I want my company_btn (company button) in navigation_mc to navigate back outside to scene 1 and proceed to play the contents of companypage_mc. companypage_mc is visible = false, and I would like to make its visibility true and start its tweens from frame 1.
Inside navigation_mc:
company_btn -> On Click, go to scene 1 and play frame 1 of companypage_mc, making visibility = true.
i have three mc's that look like cd's Three instances of the same movie clip. they go into a player onRelease. do any of you know how to do this... if i click on a cd it looks if any other cd's are clicked. if anyof them are clicked then it tells them to gotoAndPlay (thisKeyFrame) in that cd movie clip(which would be a simple tween and will look like the cd comes back out).
i tried setting variables in the cdMovie clip like on the first frame onValue="no" but once it goes in and stops the onValue="yes". and then i had AS on each cd looking if the onValue variable is yes or no in each one of them. but for some reason it can't read it? Do you know what i should do? maybe create an object or something for each button?
Can anyone tell me how to set variables in a child movie from a parent movie?[code]but it doesn't work!txtChild is a variable in the child.swf movie. (A dynamic text field with instance name "ChildText")
For a project I am working on, I need the focus to be on a test field when the site loads. I can get the focus to be on the text field in the swf file, but how do I set focus to the swf file in the first place in the browser.
I am trying to set up a if function for a hit test. I am using action script 2.0 am coding all in one layer not within movie clips so dont give me code in that format unless nececary.I have a movie clip with instance name src_resolute and I have another movie clip that is nested inside another movie clip named endbar.What I am trying to do is when src_resolute hits endbar I want it do gotoandplay the next scene.The parrent movie clip of the nested movie clips instance name is background.If you need any more infromation let me know but basicly what I want to do is when my main character(src_resolute) makes contact with the nested movie clip(a movie clip I have drawn inside of another movie clip) I want it to jump to the next scene or more specificaly scene 4.
I can't seem to get my head round why when I set the colortransform object for one clip in my movie, it seems to affect the entire movie - textboxes and everything..I thought that a colorTransform it only affected the specified and child clips in the movie.Example - I have a lot of things attached to _root.I have a particular clip which is on its own and is attached to the _root - this is my code...Code:clip.transform.colorTransform = new flash.geom.ColorTransform(0.05, 0.05, 0.05, 1, 0, 0, 0, 0);That seems to set the clip nice and dark as I want it to - but it also sets all other clips and all clips dynamically added afterwards to have the same colortransform settings... am I missing something from the CT object?