ActionScript 3.0 :: Control MovieClips Held In An Array?
Jun 9, 2011
I'm trying to create the very basics of a isometric map. My engine creates to map fine, but it's when I want to then control the movie clips.I'm adding each cell in the grid using and array:
Code:
for (var X= 0; X < Engine.Var.GridWidth; X ++)
{
[code].....
View 3 Replies
Similar Posts:
Aug 25, 2009
I need to zoom in (therefore scale up) some static fields held in movieclips. They need to be BIG but when they are scaled up they lose some definition, looking a bit pixelated on the edges. Does anyone have any advice on how to keep them looking nice and smooth when they are scaled up?
View 1 Replies
Feb 21, 2011
I want to resize an image which i have held within an array so that they can be used for thumbnails.
images show in full size i want them resized as i am using the same image for both the main image and the thumbnails to help keep the file size down. Below is the code its all working great now apart from the resizing which i have tried doing all sorts and i cant figure it out.
function loadImage(filePath:String):void
{
//for loop to load thumbnails
for(var thumbnum:int=0; thumbnum<6; thumbnum++)
[Code].....
View 2 Replies
May 23, 2011
I'm using the following parallax class, which I downloaded from fuoridalcerchio.net, but it's no longer available:[code]I created a mc container named parallaxContainer, which holds the parallax items, and defined it's class as ParallaxBox. Then, to initialize the class, I used (as per the instructions that once were posted on the site I mentioned):[code]
Right now I have just added one item for testing purposes (bg) and it works perfectly as long as I don't resize the browser window. I'm no programmer, but as far as I can tell, the class adds items to the array "theObjects" using the function addParallaxItem. The first value is the instance name of the object to add, the second is the horizontal range in pixels which the object is allowed to pan (set to 960 since my stage is 960px wide) and the third is the vertical range(which is set to 0). I can't post the link since my post count is less than 50, but the thing is if the browser window is larger than 960px, the "bg" movieclip shouldn't travel 960px to either side to reach the edge. I'm not very good at math, so I don't know how to calculate the new distance it should travel, which should be less. If someone wants to help, I can PM the link so that you can see what I mean.[code]Obviously, even though the value of the variable is updated, it's not passed to the array.
View 0 Replies
Dec 7, 2011
What happens when an object which has a function currently being executed has all its references removed?I want to have a dialog box type object held in an array by the main class for my program, and when the dialog needs to be closed, I want it to be removed from the array during that close-screen function. My question is, assuming the dialog box object is in all other ways eligible for garbage collection, what happens to the code it's supposed to be executing?
Edit for clarification:The array is a layer of visual elements in my program, of which the dialog box is one. The idea is that the "OK" button (or whatever) that closes the box will also remove it from the array of objects being displayed at the same time.
View 2 Replies
Nov 17, 2010
I used to work in AS2 and something like this worked:
mc1.mc2.onRelease = function () {
mc3.gotoAndStop(2);
}
But converting it to AS3, it doesn't work anymore.
function goMC (e:MouseEvent):void {
mc3.gotoAndStop(2);
}
mc1.mc2.addEventListener(MouseEvent.CLICK, goMC);
What am I doing wrong? I can't seem to control movieclips within movieclips.
View 2 Replies
Apr 3, 2011
i have one mc (movieclip).mc has inside a mc1 movieclip. my question is
[Code]...
View 1 Replies
May 26, 2011
For what ever reason I can't get an MovieClip that's on the main timeline to play from another MC.It appears that when targeting a MovieClip on the main timeline, root and parent don't seem to work in AS3. Or at least not in the same was as AS2.So inside a MovieClip called control_mc, I want to tell myStage_mc, located on the stage, to start playing when the play head reaches a certain frame inside control_mc.inside control_mc I've tried,
myStage_mc.play();
root.myStage_mc.play();
parent.myStage_mc.play();
myStage_mc.parent.play();
myStage_mc.root.play();
Flash complains, access of undefined property.
View 1 Replies
Jun 6, 2010
I'm new to flash, so I am sure I am missing something basic, but I have not been able to reference movie clips independently in code. I have set an instance name on each symbol, but when I reference in code it is undefined.
If it matters my project is set up this way:Using Flash 4 Pro. Layer one: Static Background Layers two-five: individual movie clips Layer six: transparent buttons over the movieclips.The buttons work fine, but I wanto to play the movieclips on mouse over.
View 4 Replies
Aug 28, 2009
Suppose I have movie clips named mc1,mc2,mc3,mc4... In as2[code]...
View 1 Replies
Nov 18, 2009
I received help on this site on this info-graphic im doing and the solution was to use an "array" which im not familiar with at all. the person that helped me added the following code that worked:
var city_arr:Array = new Array("louisville");//filll that array with all nedded cities//make all the boxes invisible at startfor (i=0;i<city_arr.length;i++){ var [code]...
since i dont know how to use arrays im stuck. i need to add at least 30 more cities to my info-graphic but don't know how to use the naming conventions of an array.Only one of the houses works (when you click on it a pop-up appears, is draggable and has an x to close the pop-up)
Attachments:
relocation_working.fla.zip (975.1 K)
View 1 Replies
Aug 26, 2009
I built my website on the main timeline with a fade in animation...stop(on the page) and a fade out animation. At the end of this fade out animation i would like it to call upon a variable to know what page to go to next.I am trying to tell my main timeline to gotoAndPlay a frame based off of a variable within a movieclip(about_mc this movieclip contains another movieclip which acts like a button(factsheet_mc)) that i have set in my main timeline.I set the variable with:
var buttonFrame; in the first frame of the main timeline
then within my movieclip i have another movieclip which tells my main timeline to play the out fade and remember a variable:
this.onRelease = function(){ --------"this" meaning the movieclip factsheet_mc------------ [code]........
View 1 Replies
Nov 10, 2011
I have a base move that loads other movies into an empty clip [code]...
View 3 Replies
Nov 19, 2009
What I'm trying to do is control movieclips that are within a movie clip I have added to the stage.
First I did this:
var navcon:NavigationContainer_mc = new NavigationContainer_mc;
addChild(navcon);
This worked fine. But within this there is a mc called printBtn_mc that I want to target.I tried to declare it as a variable like I did with NavigationContainer_mc, but it doesn't work.
View 9 Replies
Sep 17, 2010
I want to play various sound objects a certain amount of times when the playhead reaches a certain frame and then stop playing (even if the playhead reaches the same frame again).
I hope someone will be kind enough to help me solve this problems I'm having controlling each sound.
Setup Details I'm using the load movie method to load another SWF (welcome.swf) file into a movieclip in the _root SWF timeline (main.swf), and using separate movieclips in the _root SWF as holders for each sound object i declare like so:
welcome.swf (its FLA file holds all the sound files in the library with linkage id's as per the following actionscript located as a frame action in frame 1:
[Code]...
View 1 Replies
Oct 25, 2005
I download a tutorial to make a digital clock now what I want to do is make my movieclips go to a different frame depending of the hour. I want to make that effect of day/night.
View 6 Replies
Jan 30, 2008
[URL]
I have an exhibitor list that loads from xml...and I have a booth layout that loads from a separate xml...I have two arrays set up so that the rented booths are stored first, and the exhibitors are stored in a separate array side by side...
if you click on an exhibitor in the list you will see the associated booth highlight in the mainwindow (and minimap too)...however if you notice, there are multiple entries in the list for some exhibitors, this is because they may rent several booths...I want to condense the exhibitor list to have one entry per exhibitor, but have the entry control all their booths, so if you click an exhibitor with 2 booths both of them would light up even though there was only one entry in the list...is this even possible with the list component provided by flash?
View 2 Replies
Sep 22, 2002
I am creating a Flash movie that has some PowerPoint-like pages in it. I've created an nice clipEvent script that make bullet points slide in and bounce to a stop. I want a whole bunch of clips to do the same thing, and I'd like simply to define a script globally at the beginning of the movie and apply it to all those different clips, that way if the client asks for changes I only have to change the one script, not dozens of them.
onClipEvent (load) {
originalH = this._x;
this._x += 500;
speed = 75;
pass = "right";
[Code] .....
View 2 Replies
Feb 15, 2005
I have a problem with attaching more than one movie clip to this control structure, I need to attach 8 different movieclips. Till now the code attaches only one mc the "window".
windows = 8;
for (c=1; c<=windows; c++) {
attachMovie("window", c, c);
}
View 4 Replies
Feb 23, 2012
I'm using AS3, CS5.5, on Windows764bit. I created an animation with many different layers (and nested movieclips) on the stage, then wrote a short bit of As3 to add a slider control of the playback. The problem/mystery is that when I change the slider, the nested MCs act strangely/independently. How to control everything at once? Here is the current file: [URL]
Here is the code I added:
package {import flash.display.*;
import fl.controls.*;
import fl.events.*;import flash.text.*;
//for TLF crap public class SliderClip extends MovieClip {
var slider:Slider;
public function SliderClip() {
[Code] .....
View 1 Replies
Mar 2, 2011
I am loading an swf created in flash professional cs5 via the loader class into a flex 4.1 application. The flash file contains multiple movieclips that are exported for actionscript and those movieclips exist in many instances throughout the movie.
Iterating through everything, comparing class types seems to be the most easy but also the most redundant way to solve this. Is there any way of using the class name as a kind of global selector to access the clips?
I could also make the sub-clips in the flash listen for an event on which they perform an action, but I am not really sure what might be best.
View 2 Replies
Feb 22, 2012
What I'm trying to achieve is a basic theatre Box Office application, to show the public the location of the seats that they have bought.
I've got 2 flash apps. One on the clerk side which takes the seats in a csv format and then uses local connection to send the data. [code]...
View 1 Replies
Mar 10, 2012
I have 2 swf files. One is loaded and loading an externally loaded swf into it.Here is the code in the first loaded swf: #1
var logo:Loader = new Loader();
logo.load(new URLRequest("images/Logo.png"));
logo.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadLogo);
function LoadLogo(e:Event):void
[code]....
EDIT:I am having major SANDBOX issues now when I make the clip load from an external URL. I am also coding for an ANDROID using FLASH CS5.5. Its not allowing me to use Security.allowDomain("*");
View 1 Replies
Feb 2, 2009
The proposed task has to do with the creation of an application in which the user will be able to insert, drag&drop and remove rectangles. The properties of each rectangle (name,x,y) should be saved in an xml instance.
1.Create a vertical toolbar with the above buttons:
a.new rectangle
b.move
c.delete
2.Create a movieclip that will be your workspace on the right of your toolbar named stage.
3.Create a function that will be triggered by the new rectangle button and will attach to the stage rectangles as movieclips named rectangle(i) (rectangle1, rectangle2,...).
4.Create a function that will be triggered by the move button and will drag and drop a selected rectangle.
5.Create a function that will be triggered by the delete button and will remove a selected rectangle.
And what I have done so far is:
i = 1;
newrectangleButton.onRelease = function() {
stageMC.attachMovie("rectangleID", "rectangle"+i, i);
stageMC["rectangle"+i]._x = Math.random()*stageMC._x;
[Code].....
View 0 Replies
Mar 10, 2009
so im making a portfolio website that is composed of 3 general movie clips all located on the main stage.
STAGE ---> mainscreenMC
---> recentworkMC
---> newsMC
[code].....
View 4 Replies
Apr 15, 2011
lets say i have dynamically duplicated movieClips ID's stored in array list. i want to add a onPress event to them. how do i do it?
[Code]...
View 5 Replies
Jun 12, 2011
im currently making a game, and the game has some powerups, that when picked are stored. the problem is that, if i have, say, 3 shields, e press the matching button and the 3 shields are used instead of one. i found out its because i was checking the button pressing every frame, so i created a flag that checks if a button is corrently being pressed. here's the code
[Code]....
View 2 Replies
Feb 19, 2011
1) add a SimpleButton to the stage and view the SWF2) then press and hold the mouse button down OUTSIDE of the button's boundaries3) then drag the cursor over the SimpleButton while still holding down the mouse button......Then the SimpleButton on the stage does not detect the mouseover and display its 'over' state. It just stays in its idle state. Why is this? And is there a way to enable the SimpleButton to display its over state while the mouse button is being held down and then the cursor brought on top of the button (as described above)?That's the abstract, and if you are at all curious (this won't elaborate on the question, but maybe help you visualize a practical scenario) what's motivating the question, it is an application I'm building. In this app, the user is able to drag video thumbnails in order to rearrange their order.
View 3 Replies
May 4, 2005
[code]for the part that says "if(???)" i am trying to get it so if the user presses key+wp(key65) it does an event. how do i do it without having to put it inside onClipEvent
View 3 Replies
May 4, 2005
crouching = false
wp = 65;
MovieClip.prototype.key38 = function() { //down
if (!this.crouching) { //if crouching is false
[code]...
for the part that says "if(???)" i am trying to get it so if the user presses key+wp(key65) it does an event. how do i do it without having to put it inside onClipEvent.
View 3 Replies