ActionScript 1/2 :: Changing Lots Of Movieclips At The Same Time?

Aug 11, 2009

Is there a way to make many movieclips change the same way, off the same line of code.. rather than having to write them all out seperatly?
 
eg.
 
If this was the original code...
 
clip1_mc.onRollOver = function () {
clip2_mc._visible = false;
clip3_mc._visible = false;

[Code]....

The above doesn't work... but i'm wondering if anyone knows of a method that will work... saving me from having to write so much code in future?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Working With Lots Of Movieclips At The Same Time?

May 14, 2010

I'm a game developer and I have been (trying) to optimize an engine I'm making for my game. So far I have done almost every code trick there is (almost, because I'm not even close to be a professional programmer so I don't know how to do this perfectly )The game is working very smoothly now, I'm impressed, but its still generating some issues with MovieClips. When I load a new map, it loads up a movieclip that contains all the ingame objects (Screen). Inside, I add all the enemies, player and map elements I need. After that, I sort the index of the objects inside it by their position on Y.

While this works fine (using vector), my problem is that each map has like 30-40 movieclips (like doors, walls, etc), plus the player (another movieclip), plus some objects (20-30 movieclips), plus some enemies (10-40) movieclips... and when I move the camera (following the player), all the flash window area needs to refresh, and generates lag. If I only have the doors, walls and player, it runs ok... but when I start adding the enemies and other objects... Is there any efficient way to work with movieclips? Notice 90% of map elements like doors and walls are a movieclip with only one frame.

View 1 Replies

ActionScript 2.0 :: Changing Lots Of Movieclips Color And Border Color Separately?

Dec 23, 2008

I am in the making of a isometric level editor, and I have about 15 movie clips with more to come. I want to let people change the color of tiles to what they want from a list of colors, so how can I let them change the color of a tile dinamicly with actionscript so that it changes a tile's color while preserving changes of "shadows"? I mean I have let's say a cube and to make it look 3D I need to change each face to make a feeling of 3D and not a flat one.

View 1 Replies

ActionScript 2.0 :: RGB Changing Is Working But Not Changing All The Time

Feb 1, 2006

basically when you load the .swf it changed everytime u re-load it , i want it to keep on changing even when the user hasnt reloaded the image

[Code]...

View 1 Replies

ActionScript 1/2 :: Changing Pics In Movieclips?

Mar 29, 2009

I have set up an animation that displays icons on agrid. Right now everything is working ok.I have an array of 4movieclips that are randomly selected to display on the screen.Each has a timeline that brings it from alpha 0 - 100. So far, soood.Now I have to add the remaining 200 icons. Now of course Icould make 200 more movieclips and add them all to the array butthere must be a better way, right?I thought I could just have just one movieclip and switch thepic out from an external xml list. But if I import them they won'twork with the alpha transition because they aren't movieclips,right?

View 3 Replies

Changing Order Of Movieclips On Stage?

Nov 21, 2010

I have some movieclips on my stage that are there via timeline. I also add movieclips on stage using addChild.

What is the best way of changing the order of the movieclips because they overlap sometimes? eg.

mc_a is on the stage already
mc_b is called on stage using addChild

Can I change the order of mc_a using script even though it was already on stage?

Can I remove mc_a off stage using script?

How do add mc_b under mc_a so that mc_b does not overlap mc_a?

View 2 Replies

ActionScript 2.0 :: Changing Tint On Movieclips?

Apr 4, 2011

I am using the following code to change the alpha value of all movieclips except the rolled over one on rollover...

ActionScript Code:
on (rollOver) {
function allAlphaButOne(thisClip:MovieClip, alphaNum:Number) {
for (o in _root) {

[Code]....

But cant seem to replace the alpha in the first script with running this

View 2 Replies

ActionScript 3.0 :: Changing Multiple MovieClips?

Jan 25, 2009

When i roll over the gallery buttons they light up when i roll off they go back to normal.when i click on one of them it stays lit up. My problem is when i click i need to be able to set any button that was clicked back to its original state and i cant for the life of me seem to be able to do that.

View 1 Replies

ActionScript 2.0 :: 20 MovieClips - Changing State Of Button

Jul 3, 2009

I have 20 buttons (mc's). I want to be able to select one and have it stay in the down state until another is pressed. Frame 1 is "up" frame 2 is "down". I have an array of the buttons(mc's). This piece of code works but doesn't return the button to the up state when another is selected.

function changeButtonState(a){
var i = 0;
for (i=0;i<=19;i++){
if(a=="S"){_level0.sb[b].gotoAndStop(2);isw = 1;}
}}

The array of buttons is called "sb".

View 2 Replies

ActionScript 3.0 :: Showing Movieclips With A Changing Delay?

Oct 29, 2010

Using a for loop I've created a few instances of a movieclip, but I'm having trouble trying to having them appear one after the other at an increasing pace.

For example, I want the first clip to show with a delay around 2 seconds and the last with almost no delay.

So far I've only been able get Timer or setInterval to have a single delay setting.

I'm not coming up with anything other than coding on the timeline which I'm trying to avoid.

View 1 Replies

ActionScript 2.0 :: Changing A Variable After A Certain Time?

Jun 5, 2006

I would like to have a button that when clicked changes a variable for 30 seconds and then changes it back. For example:

[Code]...

View 1 Replies

ActionScript 3.0 :: Changing An Image During Run-time?

Aug 13, 2010

I have an set of images (all icons) which I want to be able to change during run-time. I already imported all of them into my FLA into the library and already instanced one of them as a MovieClip (right click -> convert to MovieClip).

How to change the image associated with my movieclip instance in code, so I can change the image to any other of the images that were imported into the FLA's library?

View 2 Replies

Actionscript 3 :: Changing Movieclips In FlashDevelop (or Other IDEs With No Graphics)?

Sep 23, 2011

I am doing this:

[Embed(source = "../lib/hfront.swf")]
private var charfront1Class : Class;
private var charfront1:MovieClip = new charfront1Class;

in order to create a movieclip object in FlashDevelop. Because there is no option (like in CS5) to give a library object a class inherently.What I need to do is be able to switch which movie clip is being displayed as my character walks about. Do I have to create a separate class for each movieclip and call them in and out of visibility?? Or is there a better way, a way to "switch" which movie clip my current class is pointing to?

View 1 Replies

ActionScript 2.0 :: Changing Frames Of MovieClips (via Menu Interaction)

Aug 1, 2004

how to jump from one frame a movie clip, rot menu, to a frame of another, main, through a button in rot menu, rot menu is a movie clip in symbol 1 which is in another (cant remeber) in main. from frame 1 of main i want the button to be pressed and it takes you frame 2 of main.

View 1 Replies

ActionScript 3.0 :: Changing Images After Time Interval?

Sep 22, 2009

I want to show images that am calling from xml file into flash, I want to show them each after a certain time interval, I want to do this in AS3 How it can be done?

View 1 Replies

ActionScript 2.0 :: Changing A Background Picture With The Time?

Mar 9, 2007

writing a code that will change a picture base upon the time.

i want to have a picture of the sun rising between the time 6am to 11 am

then from 12pm - 5 pm a pic of the ocean showing

from 6 pm - 10 pm- a pic of the sun setting...

then from 11pm- 5am a picture of the northern lights..


ohh yeah i have the time being called in a # from 1-24, = var = hour

idk if u can write if statments with a range of numbers . ex. if (hour > "range of time/#'s") ....

or have a shape in the backround and have it change as the time changes??

View 4 Replies

Arrays :: Changing Child Index Of MovieClips Based On Their Y Position?

Mar 1, 2012

I'm writing a game with Flash CS5/AS 3.0 that tries to simulate depth of field by drawing all the relevant Movie Clips based on their Y position in ascending order, i.e. things lower on the stage overlap things higher on the stage. A MovieClip with a Y position of 10 would therefore need to have a lower index compared to a MovieClip with a Y position of 20, so the second one gets drawn on top of the first.

I wrote a quick and dirty function just to test this. During the trace, I've noticed that the truck's index hits 0 when I go near the top of the stage, but if I go too far up it will completely disappear from the stage. Trace then starts generating this error:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/getChildIndex()
at EICT::Game/ReorganizeDisplayIndexes()

[Code].....

View 2 Replies

ActionScript 2.0 :: Changing Background Depending Time Of Day On Site

Apr 13, 2009

I'm building a site that will change the background depending time of day. I do want to show the time in the top of my page. What are good codes for showing a time and date in Flash and what would I use to change background depending on if the time is past 7PM or before.

Example.
If the time is before 7PM I want it to show a background with a clear blue sky. If not then the background will be a starry night. I'm using CS3.

View 2 Replies

Flash :: Changing Tab Border Color At Run Time In Flex?

Mar 19, 2012

How can I change border color of tab in tab navigator control at runtime? I am trying to access it with its id "mytab" and update it's style.

this.mytab.setStyle("bordercolor","red"); A TabNavigator has multiple tabs and I have to change style of few tabs based on some logic. StyleDeclaration is applicable for all the tabs under tab navigoter but how can use CSSStyleDeclaration based on componentid? The only shortfall with this approach is that Style can not be changed for individual tab.

View 1 Replies

ActionScript 3.0 :: Changing The X Position Of Two MovieClip Instances At The Same Time?

Apr 26, 2011

This is a 2 part question really:

1) I'm trying to change the position of two different MovieClips instances to the same .x position. It works individually, but as soon as I put this code in, it says that it cannot assign it to a non reference value:

ActionScript Code:
coinArray[1].x && coinShadowArray[1].x = -591.5

2) I have a whole load of variables which are all going to different .x positions at the same event trigger - something similar to this, but there's around 30 of them:

ActionScript Code:
object[1].x = -560
object[2].x = 764.45
object[3].x = 700.45
object[4].x = 740.45

View 4 Replies

ActionScript 3.0 :: Changing Flash/timeline Based On Server Time?

Aug 28, 2009

I'm trying to get the time from the server (php) and then display a different flash movie (via either a different swf or frame on timeline) accordingly.

Unfortunately I haven't found anything that relates to this using as3.

View 2 Replies

ActionScript 2.0 :: HitTest Using AttachMovie - Movie Clip Is Changing It's Name Every Time

Mar 19, 2010

I am working on doing a hitTest using one attachMovie and one repeating movieClip. I am running into trouble because the movie clip is changing it's name every time it's created (panda1, panda2, panda3, etc...) and the attachMovie, fire, is not recognizing the created MC's. here is the code to create the movieClips:

[Code]...

View 3 Replies

Flash :: Professional - Animate - Invisible Hotspots Changing Position In Time

Jan 27, 2011

I'm creating sort of a game in Flash, which requires invisible hotspots changing their position in time, relative to the stage. The question is: can I simply keyframe the hotspot position and have it work, or is there something that I should consider?

View 5 Replies

ActionScript 2.0 :: Create Auto-scroller To Reuse It Without Changing Different Values Each Time?

Feb 19, 2005

I created a auto scroller which works fine but I would like to change it so that I can reuse it without changing different values each time.The movie consist of a scrollmc and a maskmc (just a rectangle)

[Code]...

View 7 Replies

ActionScript 3.0 :: Control Several Movieclips At Same Time?

Aug 28, 2009

Suppose I have movie clips named mc1,mc2,mc3,mc4... In as2[code]...

View 1 Replies

ActionScript 2.0 :: Load MovieClips At A Certain Time?

Dec 16, 2009

Every 5 minutes, a new movieclip should be loaded.These movieclips show a message 'still 20 min to go', 'still 15 min to go', ...

The project should start by a button in the first movieclip.

View 2 Replies

ActionScript 3.0 :: Duplicating Run-time Generated Movieclips?

Aug 24, 2009

Currently I have a function that makes a movieclip copied from one specified in the GUI,moves it to a certain point on the stage, then ends. This is called several times to create various patterns etc on the stage.

Code shown below:Code:
function draw_block( iX, iY , sBlockName )
{

[code]....

View 11 Replies

ActionScript 2.0 :: Control MovieClips Depending On Time

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

ActionScript 2.0 :: Movieclips Get Smaller At The Same Time As Fading?

Aug 1, 2003

The following actionscript is some that I got from lostinbeta from an alpha fade question I had, that works fine but I now would like to have the movieclips get smaller at the same time as fading. So I put in some code that went like this

[AS]
//set the transform
mc._xscale = (i*10);
mc._yscale = (i*10);

[Code]...

View 14 Replies

AS3 :: Flash - Using Lots Of Sound In A Project?

Apr 14, 2011

I have around 400 sounds in my flash file.Is there anyway to go about using them with having to instantiate them all.I will be storing them in an array.

var sound1:Sound = snd1;
var soundN:Sound = sndn;
var mySounds:Array =[sound1,soundN....];

I already have linkages in the library as sound1,soundN,etc

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved