ActionScript 2.0 :: How To Get Sequential Colors To Be Displayed
Dec 23, 2003
Here is a script that allows a random color to be displayed, how do I alter the script to make it not random but, sequential from white through all the colors to black.
Here is the script:
onEnterFrame = function () {
myCol = Math.round(Math.random()*Math.pow(6, 16));
beginFill(myCol, 50);
moveTo(100, 100);
lineTo(200, 100);
lineTo(200, 200);
lineTo(100, 200);
lineTo(100, 100);
endFill();
};
I wonder what kind of class(es) I should use to accomplish this task. I have two predefined colors, 0xFF0000 and 0x00FF00 (red and green), and I would like to set a number of gradiants of colors between these two colors. [code]This generates a random color, but I don't want to generate just any random one. Does anyone know what kind of color class I should use to accomplish my task objective?
I would like to give two actions to one movie clip. I mean when I push a button a movie clip has to execute two sequential function. The second function has to wait for the first function to complete before it starts.To see an example click the following link:
Link Entering the site and clicking on one of the bottom buttons gives the result where I'm looking for.After the first time clicking on, let's say annoucements, clicking on one of the other buttons is giving the result the the white mask cover the stage and the opens again and an other mc becomes visible.
I was just wondering if there is a nicer way than setting flag variables etc. to accomplish this.Example: trying to have a pannel slide closed, then it opens with the text. The text is changed and displayed by the time it opens.When I have something like
The problem is both processes start and you see the new text as the window closes.Is there a way to have your code not execute the next line until the previous line is complete?e.g. if movie was finished playing, then perform line 2.
What I want to do is have a menu where the user navigates by clicking buttons in a sequential order. For example, if the user clicks button 1, then 2, then 3, they are taken to page 1. If they click button 2, then 3, then 1 they are taken to page 3, etc.
I'm really just not sure where to start or what terms i could use to search for info on this. I have tried many combinations with "sequence" and "sequential" with no luck so far.
In AS2 I used to be able to set up a FOR loop that would program sequential buttons. Now, I'm trying to do it with AS3 and I can't seem to get the function-part right. The last function is the only one that works. Here's some sample code...
PHP Code:
for (var i:Number = 0; i<3; i++) { this["quiz"+i+"_mc"].go_btn.addEventListener(MouseEvent.CLICK, goButtonEvent);
I'm trying to play 3 flv video, one right after the other but is unsuccessful. All it does is skip the other 1st 2 videos and play the last video in the array. Here's my code: var myArray = new Array("commercial.flv", "intro.flv", "sleep.flv"); this.attachMovie("videoHolder","mcVideoHolder",this.getNextHighestDepth()); mcVideoHolder.swapDepths(preloader); var nc:NetConnection = new NetConnection(); nc.connect(null); [Code] .....
It is possible to loop through buttons in a movie clip that do not have sequential names.For instance, they are all named by the date they are for reference to a database.
I'm doing a flash movie in as3 where there are two or three swfs. What I want to do is play them in a sequential order, wherein when one finishes, the second one starts. The swfs are called movie1, movie2, etc. The best way is probably to use an array and load swfs into the 'overall' fla file that will play them. I use a variable called movieNum that keeps track of each movie. I am also using a Loader command which is just called loader. My loadSWF function works fine, but my eFrame function is flawed. I cannot find a way to recognize the end of the last frame of movie1.
var request:URLRequest; var loader:Loader; var myMovies:Array = ["movie1.swf", "movie2.swf"]; //my movie array var movieNum:int = 0; //start at 0 function loadSWF():void [Code] .....
So, two or more SWFs called movie1, movie2 etc., and having movie2 start after movie1 finishes in an overall fla.
I have a button that needs to goes back to the last frame. But the user can get to each frame in different configuations so back is not a sequential frame. Is there a way to go to the last frame that was accessed?
I am trying to make a script that will count up to the designated number...if the set number was 50 then you would see all the numbers 0 through 50...and to make things even more fun I also need it to be for currency so I need a decimile point i.e.. $50.00
I have set up an xml thumbnail gallery using some of the great tuts on this site (I'm a designer so this dev stuff tends to get a little confusing). Basic setup is quite simple:
xml holds titles, thumb urls and details set up thumbs as a grid system, so they're loading in as columns, all of which is working great.
I have run into a bit of a brick wall though, and that is how to get the thumbs to sequentially load in, instead of random as they currently are.
Code: ... function GeneratePortfolio(portfolio_xml) { var portfolioTitle = portfolio_xml.childNodes[0].attributes.title; var rootUrl = portfolio_xml.childNodes[0].childNodes[0].attributes.rooturl;
say you have 10 thumbs and those thumbs are referenced from an XML file. You want to load each thumb onto the stage and give it a sequential id variable. So, you first go through a for loop to attach the container MCs to the stage, giving them each an id variable equal to i at the time of the for loop execution. Now, the problem is that when you load something into that container MC it over rides the id that you set using the for loop. I'm using MovieClipLoader so I can assign properties and variables and such once the thumb image has loaded, but how should I do it so that the thumb knows which id it is?
I'm not really looking for a specific answer but really more something that I can target my research around. Here is what I'm working with: -this all need to pre-load. -I need to build a flash image banner -When you click a image they take you to a corresponding HTML page. -The first few images in the banner sequence need to play in sequential order so for example image00, image01, image02 in order. -Then once the first few images have played in sequential order images will be selected and played at random. Now here is the tricky part the random image selection can't pick to of the same images in a row. -The universal transition from one image to the next should be an alpha fade down of the top image exposing the random or sequential image below. Yeah I know that a real mouth full.
- Flash CS4 Actionscript 2.0 internal training project- Main movie is a single frame project, containing just the interface. This includes a menu listing 80+ individual "chapters" for the training series.- Each "chapter" is its own project/swf. Once the main interface loads, it should begin to play the chapters sequentially without the user selecting anything from the menu. When one chapter finishes, the next should load. If the user DOES select a chapter in the menu, it should load that SWF, and continue auto-playing from that selection forward.- Each chapter has a built-in play/rewind/ff bar, various movie clips with animations, dialogue audio track and a fairly lengthy embedded FLV movie, and therefore a preloader before each chapter is mandatory.What I have so far works, but it's embarrassingly crafted:- First frame of main movie (let's call this main.fla) contains the following code (most of this code was taken from an online tutorial):
var slideName = "modules/intro.swf"; var loader:MovieClipLoader = new MovieClipLoader(); loader.addListener(this);
Im trying to make a dynamic site banner that will load in swfs detailed in a XML file. I think the best way is to load them in separate MCs and then start the first one one it has preloaded then move to the next to preload and once the first swf has finished a piece of code tells the _root timeline to play the next... and so on.
I have got it so the container swf loads in the swfs but the preloader is not quite working and I have no idea how to get this sequential thing working especially with next/pev buttons. Currently it seems that the loader is not quite working with the first file and all files are loading in at once. I need the player to wait and load sequentially.
Following is my code and attached are the files. Please help and much appreciated.
Code: stop(); /*******************************************************************/ /**********************UNIVERSAL VARIABLES AND SETUP****************/ // constants
function personal(Name:String,age:int,city:String):void{ trace(Name+" is "+age+ " years old and lives in "+city+ ".")} The parameters can only(???) be passed in the order they are declared in the function as
Im trying to make a dynamic site banner that will load in swfs detailed in a XML file. I think the best way is to load them in separate MCs and then start the first one one it has preloaded then move to the next to preload and once the first swf has finished a piece of code tells the _root timeline to play the next... and so on.
I have got it so the container swf loads in the swfs but the preloader is not quite working and I have no idea how to get this sequential thing working especially with next/pev buttons. Currently it seems that the loader is not quite working with the first file and all files are loading in at once. I need the player to wait and load sequentially.
I want to have each text identified as marketLocation1, marketLocation2, etc up to 150 and I wanted to use a 'for loop' to place the value of that XML node into each labeled textfieldHowever, the only issue is... each individual text field is buried inside a button so that the button displays on mouseover an associated XML fields data.Meaning, I mouse over a dot on a map (button) and it pulls up a statistics balloon about that location specific to our companies needs. I'm a total AS3 noob, so I'm not sure if I should be calling to the XMLdata loaded for a specific set of values on entry to that mouseover, or if I can preload the data for that button into it's specific text fields.Specifics are for the xml/flash file
Code: <market MarketID=1> <marketLocation>Raleigh-Durham-Chapel Hill, NC</marketLocation>
can anyone figure out this attachMovie problem?i'm guessing it's because i'm not using removeMovieClip, but then i'm not sure how i'd go about using removeMovieClip in an incremental way.in the following example, i have it setup with an mc on stage with an instance name of "holder":[code]man i screwed up before in a similar situation but i'm not sure how i came to a solution.
-When you click a image they take you to a corresponding HTML page.
-The first few images in the banner sequence need to play in sequential order so for example image00, image01, image02 in order.
-Then once the first few images have played in sequential order images will be selected and played at random. Now here is the tricky part the random image selection can't pick to of the same images in a row.
-The universal transition from one image to the next should be an alpha fade down of the top image exposing the random or sequential image below.
After a click event I want to dynamically create 2 movieclips with the sequential number in their name, e.g. mc_001 & mv_001 so that I can 'link' them together later on. How can I create a movieclip with a dynamic name? I am trying to use this at the moment: Code: var movieclip["name"+dynamicNumber]:MovieClip = new MovieClip(); I can't use an array unless someone can tell me how to access it across multiple classes...
I am working on a FLASH website that loads 3 flash movies (header, content and menu). The menu movie is displayed at the bottom. I am looking for a way to display the menu always at the bottom of the browser window (the visible bottom). This way, if the screen resolution of the user is too small, the user won't have to scroll to see the menu. I know it can be done. On this page, you can see that the copyright character is always displayed the bottom right of the browser window.[URL]
I have a container symbol called BoxContainer. This can contain an unknown number of Radio Button components. To add these, I have an array of Radio Buttons called boxes.This is part of the CheckBoxes class.Here's my problem: When I add the radio buttons as children to the stage, from the frame itself, it works just fine. However, I need to add it to the BoxContainer movie clip. I have tried:
On the frame: for(var i in Checkbox.boxes) {[code]..........
However, both of these do not work. When I run the flash, the radio buttons are not visible. How can I fix this?