ActionScript 2.0 :: [FMX] Different Height Properties In An Array?
Dec 17, 2004
I have 6 movieclips working as buttons (about_btn, menu_btn, drinks_btn, pics_btn, guestbook_btn and contact_btn) and they are insite another movieclip called menu_mc. I control them with this function:
Code:
function setButtons() {
for (var i in menu_mc) {
if (menu_mc[i]._name.substr(-4) == "_btn") {
[code]....
I have a square on the stage that should change in height depending which button is presses. I tought it was possible to do that with an array, but i can't figure out how. This is the array with the heights:
Code:
hoogtes = new Array():
hoogtes = ["275", "250", "240", "250", "210", "200"];
note: the order of the heights in the array correspond with the order of the buttons.
View 10 Replies
Similar Posts:
Feb 19, 2009
I want to bring an image in from a folder and then display this image in a specifically sized box.[code]So obviously I want the image loaded into a 200 x 200 box (the image is 1200x1200) and scaled proportionately. What do I need to do? The box won't resize at all.
View 6 Replies
Aug 27, 2009
how to attach two objects (movieclips), with different width and height properties into the stage, with random positions,without visual colliding.
View 6 Replies
Oct 15, 2010
I have a number of 'items' (mc's) contained in a scrolling mc that can be drag-dropped to other matching mc's. The items names are listed in an array and I wish to assign variables of suitability and feedback to each mc from the array also. I think this is called an associative array?
Having some trouble correctly referencing the items from the array. To explain, here's a working script with a simple array and an inefficient workaround:
[Code]...
View 4 Replies
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
Feb 7, 2010
I currently have many buttons and respective hotspots that run using repetitive actionscript code. I would like to replace this with more efficient arrays.For example, I have a hotspot called btnCommercials and it's respective movieclip called commercials.
ActionScript Code:
var btnArray:Object = [
{btn: btnCommercials, mc: commercials},
{btn: btnMusicVideos, mc: music_videos},
[code]....
View 4 Replies
Feb 10, 2010
I'm making an array and i'm sticking a bunch of movieclips in there that I want to act exactly the same.
In as2 this was as simple, I would just write something like
"for(x in samplearrayname){
//do stuff}"
this doesn't seem to be the case with as3 because i'm getting all sorts of wacky errors. I'm seeing something called foreach() but it doesn't seem to work the same way. Would someone be kind enough to point me towards a good tutorial?
the error i'm getting is "1067: Implicit coercion of a value of type String to an unrelated type Number."
View 3 Replies
Aug 12, 2011
I've got an array
ActionScript Code:
var Arr = new Array();
in this Array I'll put some istances of a movieClip (in this example is called Clip)
[code]........
View 9 Replies
Nov 21, 2010
I recently learned how to populate a component list, using an array like this:
Code:
var colours:Array = [
{label:"Blue", data:0},[code]....
Now I want to take it a step further, and populate the component list using values from an XML file. I have loaded up the XML file correctly, but I'm not sure about the syntax to use it, as I'm not really familiar with arrays that use curly braces to provide properties. My XML file contains data like this:
Code:
<colourList>
<colour>
<colourLabel>Blue</colourLabel>[code].....
it updates the list with each item in the XML progressively, and I end up with only the final item.
View 5 Replies
Jun 26, 2011
i have an array containing all the bases in a game.... when my ship lands a proximity check is made between the ship and each member of the basesArray.. i want to iterate through the array and subtract the ship x/y from the array element(base)x/y. if the result is between 50 +/- that element becomes the active base. here's the code:
Code:
public function baseProximityCheck():void
{
for (var i:Object; i<playScreen.baseArray.length; i++)
[Code]....
View 12 Replies
Sep 15, 2011
How do you get the height and width of a 2d array? I have tried putting the entire array in a Sprite object, but the width and height is still 0. The array tiles several sprites and I want to get the combined width and height of all of them. I need to do this without adding the width and height of the individual sprites together, It has to be based on the end result of the array class. How do I do this?
View 9 Replies
Nov 13, 2011
Each item in the array in on the stage, each with an x/y position. The item in the top left most position should be items[0]. X should be the primary. Originally I was thinking along the lines of:
var items = [m1, m2, m3, m4, m5, m6];
items.sort(sortMe);
function sortMe(a, b) {
return (b.position[0] - a.position[0]) && (b.position[1] - a.position[1]);
}
But this does not yield the correct results.
View 2 Replies
Jun 24, 2009
Why I can't set properties to instance names with Array
Code: Select all// instance names:
// a1_mc, a2_mc
var allElements = new Array("a1_mc","a2_mc");
allElements.x = 250;
alllements.y = 250;
View 3 Replies
Aug 26, 2005
I have 3 mc's (clip1, clip2, clip3) and 5 buttons on the stage. When i press button 1 clip1 should go to _y = 100, clip2 _y = -1100, and clip3 _y = -500! The same should happen when one of the other buttons is pressed (with different y values though) My question is can i put the different y values in an Array, and if so how do i do so and how do I call them?
View 4 Replies
Mar 20, 2007
Code:
container_mc = _root.createEmptyMovieClip ("Page_Container_mc",100);
pageContent = new Array ();
[code].....
View 3 Replies
May 21, 2009
how do you get the length of, or number of properties in, an associative array/dynamic object?
View 3 Replies
Aug 17, 2004
have a square on the stage that should change in dimensions depending on which button is pressed. This is the code for the buttons:
[Code]....
Is it possible and if yes how to place the different dimensions in an aray and then call them in the on release?
View 14 Replies
Aug 17, 2004
have a square on the stage that should change in dimensions depending on which button is pressed. This is the code for the buttons:[CODE]function setButton() {
for (var i in menuMc) {
if (menuMc[i]._name.substr(0, 4) == "btn_") {
clip = menuMc[i];
[code]......
View 14 Replies
Sep 7, 2009
ActionScript Code:
for (var i:uint = 1; i<=10; i++) {
var ball_array:Array = new Array();
var newBall:ball = new ball();
[Code].....
View 4 Replies
Sep 29, 2009
I will do my best in explaining what is happening. I have a feeling it has something to do with how I declare things, but I am kinda new with AS3 so please have patience.
On my stage I have an movie clip (mContainer). In the library I have another movieclip (mElement), that has been exported for actionScript as mElement.
[Code]...
View 7 Replies
Sep 27, 2011
I am not sure my title is correct.Is there any 3rd-party library on AS3.0( like STL in C++), can do this: I define my class and use its objects as associative array, for example:
class Company{
var public name;
var public logo;
[code].....
View 7 Replies
Sep 27, 2011
Is there any 3rd-party library on AS3.0( like STL in C++) around, can do this:I define my class and use its objects as associative array, for example:
class Company{
var public name;
var public logo;
var public address;
var public telnumber;
}
And use a kind of data structure class(say, List) to store a few Company-type objects. And then, I define my own comparing and searching function on that List class(namely, override the default one); within my functions I could specify on which attribute(name, or address, or telephone number) to perform searching, and how it would be performed.
View 4 Replies
Mar 30, 2012
I have a little bit of code that makes a nifty kaleidoscope effect, but I would like to take it one step further by having each star in the kaleidoscope gradually shift color as it expands outwards. Right now, I create randomly colored "star" movieclips by drawing 6 different triangles within the movieclip, and then add those individual "star" movieclips to a "stars" array.
What I'd like to do is use a "for...in" loop to grab the .color property of each of the "star" movieclips and change it slightly (using colorTransform?) at each ENTER_FRAME. How can I go in and access the star.color property (or is it star.transform.colorTransform?) of each of the movieclip objects that are now stored in my "stars" array?
Would it be:
Code:
for (var i in stars){stars[i].transform.colorTransform = myColorTransform;
}OR
for (var i in stars){stars[i].star.transform.colorTransform = myColorTransform;
}
View 14 Replies
Sep 28, 2009
EDIT: I'm using CS4 I'm receiving this error: TypeError: Error #1010: A term is undefined and has no properties. at Main_fla::function_holder_mc_16/cleanList()
[Code]...
You can find my file at: [URL] Below is my function to clean my list. That part works - however for some reason I'm getting errors...
[Code]...
View 2 Replies
Nov 13, 2010
I need to have the array I've created play sequentially and load accordingly after they've moved from frame 1 to 2 to 3 and so on. Here's the code that I have. All my songs are embedded in my swf.
[Code]...
I would really like the Pause, FF, and RW functions to work too. I got an error of "A term is undefined and has no properties" I'm absolutely sure it has to do with the var index:int = sounds.indexOf(this.currentTarget); line.
View 1 Replies
Feb 15, 2012
The first 2 loops set the textfields just fine. But the next 2 give me the error Error #1010: A term is undefined and has no properties. Something is NULL, but what? Can't figure out :(
[Code]...
View 3 Replies
Mar 25, 2011
I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?
View 3 Replies
Jul 1, 2010
I am resizing a movie clips height automatically to match the height of some dynamic text that is displayed above it (will eventually be loading it from xml ). is there a way to keep a safe margin top and bottom? this is my code so far Text_Box_Graphic.height = Text_Box.height;
View 2 Replies
Nov 10, 2009
I want to constrain the height of a flex component to the height of the browser viewport.
The component's children are populated from a database table using a repeater, and are basic checkboxes. There are enough of them that the flex app ends up being about twice the height of the screen, which means some of the rest of the layout goes crappy on me. How can I force the component that contains these to limit itself to the size of the viewport?
View 4 Replies
Apr 1, 2010
How to set a Spark List height to the height of its content?Tried this:
var lastRow:IVisualElement =
myList.dataGroup.getElementAt(myList.dataGroup.numElements - 1);
myList.height = lastRow.y + lastRow.height;
It works in case of a single item, but lastRow is null in case of more items.
View 5 Replies