Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Choose A Colour Out Of List?



hey there,
does anyone know how i would go about setting up a bit of actionscript so that for each duplicate MC i make it could only be one out of the three colours i specify.

At the moment ive got this at the end of my script:


Code:
myColor = Math.round( Math.random()*0xFFFFFF );
myColoredObject = new Color ("newleaf"+i);
myColoredObject.setRGB(myColor);
this works great,makes all the MC different colours as they spawn, but i want to limit the possible colours to three at random.

any ideas?

cheers
9114



FlashKit > Flash Help > Flash ActionScript
Posted on: 03-28-2005, 12:31 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Choose Text From List In DynamicText
Hi friend, excuse my english

I have list of users in the DynamicText.
I want select one user, then that username automaticly
display in Input text...
...see figure (login proceedure)

thx

Changing List Component Colour..
Is there any actionscript that will change background colour and font colour of a list component?

Thanks.

Dynamicly Populated List - Font Colour
Hi, I've been trying to make a media player to display a few flv's, the player has a playlist (a list component) which is populated by an xml file.

I've downloaded 'VideoSourcePro' an have been trying to adapt and re-skin it for my site.

I'm doing ok with it but i cant work out where the font style for the list is set/stored. I've been all through the fla and the actionscript and I cant find anything relating to font colour.

Would anyone be able to have a look for me, I'm pretty in-experienced when it comes to actionscript and probably wouldnt notice if it was staring me in the face.


I've zipped my project up and you can download it from here.

Thanks in advance, I'm really stuck on this.
James

List Component Selection Colour (Halo Theme)
Ok I give up.

When you move your mouse up and down the list items in the List Component there is a selection rectangle. When you click an object it does a little vertically expanding animation to show that this item is selected... simple enough right?

How do I set it up so that the selection rectangle is grey but has a different colour when you select something (say green for example)?

Is there a way to do this?

---------------------------------------

Also:

There are a few things I also want to do to the component that will require some coding. Where is the code for the List Component, I've been checking out C:/Program Files/Macromedia/Flash MX 2004/en/Configuration/componentFLA/Halo Theme.fla and I've been through the library and everything but can't find anything for the List Component.

Why can't 2004 components be as easy to edit as MX? Yaaaa!! Makes you want to grab an Uzi and climb a clock tower!

Creating A Colour Dialogue Box For User To Select A Colour For Background.
Hi,
Any ideas how to create a colour dialogue box so the user can select their own pereference of background colour?
thx
shaf
(I mean inside the SWF as its running......)

16 Bit Colour Mode Problem With Alpha Fades On Colour
Please help me out. I have tried many other forums and people, but no one can give me an answer. Hopefully you can.

Have a look at a site I designed for a school.

http://www.brineleas.co.uk in 32-bit mode this is great, now try 16 bit colour mode and you will see my problem.

Please help if you know how

Trev:

Flash Colour/ Javascript Colour
Can anyone over here help with the following...

http://www.were-here.com/forums/show...hreadid=148509

Colour Picker / Colour Transform
Hi...

This query has been bugging me for a little while, and it may be easy to answer, I don't know.

I'm using a fairly simple colour transform script to change the tint of a mc...
code:
myColor = new Color(_root.bgdvideo);
if(!ccc){_root.bgdvideo.setRGB(0x990000);
}else{
myColor.setRGB(ccc);
}
MovieClip.prototype.beginFade = function(dstX, durationOfFade) {
this.myColor = new Color(this);
this.srcX = this.myColor.getTransform();
this.dstX = dstX;
this.startOfFade = getTimer();
this.durationOfFade = durationOfFade;
this.onEnterFrame = function() {
var r = (getTimer()-this.startOfFade)/this.durationOfFade;
if (r>1) {
r = 1;
this.onEnterFrame = null;
}
var tX = {ra:this.srcX.ra*(1-r)+this.dstX.ra*r, rb:this.srcX.rb*(1-r)+this.dstX.rb*r, ga:this.srcX.ga*(1-r)+this.dstX.ga*r, gb:this.srcX.gb*(1-r)+this.dstX.gb*r, ba:this.srcX.ba*(1-r)+this.dstX.ba*r, bb:this.srcX.bb*(1-r)+this.dstX.bb*r, aa:this.srcX.aa*(1-r)+this.dstX.aa*r, ab:this.srcX.ab*(1-r)+this.dstX.ab*r};
this.myColor.setTransform(tX);
ccc = this.myColor.getRGB();
};
};

I know you have to change the ra, rb, (etc) values to alter the colour which you get (as in)...
code:
_root.bgdvideo.beginFade({ra:50, rb:204, ga:0, gb:0, ba:50, bb:255, aa:100, ab:100}, 1000);
...but I wondered if anyone knows a trick / way to find out the values you'd put in for (ra, rb, etc) to get a particular colour, rather than just aimlessly playing around with different values until you get the desired colour fade you want (which takes some time for me!)

Cheers
Jeff
*sorry if this is a dumb question...

A Colour Palette For Colour Matching
I'm new to actionscript and trying to creating a pretty simple colour palette which can let users to choose up to 8 different colours. First of all users will be presented with a range of different shades, and each time they choose a colour it can be saved to a movie clip, so finally they will have all 8 movie clips showing all the colours they've chosen.

The way I do is create a movie clip that contain all the colour shades in the palette in different frames. Then make 8 copies of it and give them different instance names. When the user come to select a colour then the movie clip will change to that colour, keep it, then the other colour will go to the second movie clip... and so on... I've tried different ways to simulate the saving function but it still doesn't work (one of them is using if / else statement on the button and declare different Number value on the movie clips)

Pls bare with me if my explaination is not clear... but any help will be greatly appreciated!! Pls tell me if you got idea how to do it or any similar work that you've done. I can also email / msn the file if you wanna have a look. Thanks in advance!! vinkc@hotmail.com

You Choose 3
Here's my problem. Hope someone can point me in the right direction.

Explaination:
- I have 10 objects.
- When I click on the object it goes into 1 of 3 spots
- When all 3 Spots are filled you are done.

Problem:
- What is the easiest way to have each object go into an open spot until no spots are left without over writing a spot with another object.

Possible Solutions:
-I've tried writing an array for the 10 objects and setting the 3 spots to false but can't figuire out how to make them true once they are pulled in.
-Any suggestions would help

Thanks in advance

Choose
how can you make Flash to choose somthing like when you have a ball, that it chooses the speed of the ball?

[F8] MCL...which One To Choose
I'm having trouble with my first full screen project.The full screen part is working. What I can't figure out:

1) My MCL is dynamic and centered...but the the AS in the external swf's is for the most part, AS1, not AS2. Therefore, practically nothing works.


PHP Code:



this.createEmptyMovieClip("externalContainer", 5);
footerLinks_mc.swapDepths(6);
var xListener:Object = new Object();
xListener.onLoadInit = function(target_mc:MovieClip) {
    //position itself correctly
    trace("INIT FIRED");
    target_mc._x = (Stage.width / 2) - (target_mc._width / 2);
    target_mc._y = (Stage.height / 2) - (target_mc._height / 2);
    target_mc.onPress = function() {
        trace("NAME: " + this._name);
        //externalContainer.unloadMovie();
    };
};
var xLoader:MovieClipLoader = new MovieClipLoader();
xLoader.addListener(xListener);




Is there a way to make the AS1 work within this environment? Or...

2) If I create a MCL, not dynamic, all of the AS1 codes work fine, but I can't get it to center on the full screen stage:


PHP Code:



loadMovie("mask.swf","MCL1");
ready._x = (Stage.width - ready._width)/2;
ready._y = (Stage.height - ready._height)/2;




Any suggestions???

Thanks.

Help About AS .choose
Hi,
i don't know much about action script.
what is mean of this

_root.choose = "contacts";

and
gotoAndPlay (_root.choose);

view page
http://www.flashvault.net/tutorial.asp?ID=139

Choose Character
Hello everybody,

I'm working on a fla where you can choose your character (boy or girl) to navigate the site.

My initial idea was:

the user clicks on the boy or the girl
depending on what the user chose, the timeline lands on a certain frame and the movie clip on this frame calls in the image of either the boy or girl.

Howver is this the best way to do it?, or has someone out there got some amazing script that can make this happen better.

Please get back to me

K

Choose Ant Character
hi, first of all can anyone get on too were here forum?

okay my question i really need help on this code as i have been messing around with it for 3 weeks.

how do u go about making a mc that is selcetable? that is one of many attached to the stage.

i thought that on mouse up i could change the name? iam useing this code but nothing i try seams to work.


on (release) {
//_root.toolbox.gotoAndStop(2);
//game.currentchar.clip = this._parent;
//_root.char.clip = currentchar;
//var name = currentant;
antW.clip = game.clip.currentant;
//this._parent.movefuker = "currentchar";
}
onClipEvent (enterFrame) {
_root.moveplease();
}



this is on a key frame in the main timeline. the idea is to get that specific mc to go to frame 4 once i can do this then ill change it to suit the project.


function moveplease() {
//game.currentchar.clip._x = game.currentchar.clip.x+1;
//_root.char.clip.gotoAndStop(4);
_root.currentchar.clip.gotoAndStop(4);
}

cheers, help most needed

How To Choose Avatar
Hi All,

I am developing avatar chat engine .. and i would like the user to be able to choose his avatar .. the chat engine is reading the variables from a text file using PHP .. anybody can help !

Choose A Color
hello. I should I go about making one of those things that opens up where you have a curser and you drag it around, and it shows what color you have in hex. Like the color mixer in flash? Sorry if i'm not explaining good enough. tell me if I need to post a screenshot of what i'm talking about.

What Server To Choose...?
Hi,
I'd like to make a real time chat system to a webpage... with no rooms ... a simple instant messaging one... But I don't know what server to choose?! FMS is too expensive and eat a lot of server resources ... and I'd like a server who can have more than 1000 users... low cost and fast

thanks for your oppinions..

Choose The Best Camera
Hello,
I have so far been using the logitech pro 400. I have recently tried the logitech quickcam ultra vision.
Welle the video is not as expected.
Can anyone please tell me which is the best camera . I need to have a rather good resolution with no bandwidth limits.
Thanks for your advice.

Which Flash CMS To Choose?
Hello!

Can you please recommend me the most popular websites that provide good Flash CMS?

Thank you very much.

To Choose A Xml Database...
Hi
For instance I got 3 buttons. And their instances names are button1, button2 and button3. And I have 3 different Xml files(databases). Their names are file1.xml , file2.xml , file3.xml. How can I develop a code to use as this,
when I press or release button1 , file1.xml become loaded.
same as button2 and button3...
Here is a code that I write but it is not working?


var x:XML = new XML();
x.ignoreWhite = true;
button1.onRelease=function(){
x.load("file1.xml");
}
button2.onPress=function(){
x.load("file2.xml");
}
button3.onPress=function(){
x.load("file3.xml");
}

Which School To Choose?
Hello, i am 21 years old student from Lithuania. After 16 monts i will graduate bachelours degree (am learning philosophy and business managment)

after graduation i would like to study visual arts, at the moment i am searching for school/university. am interesting in good quality and price proportion. Am learning individually with Flash, PhotoShop, After Effects, and Poser. In future i am going to learn with Maya. Am very interesting in animation. i have 16 months to find my future school so i hope you will help me to choose.

thank you....

Evaldas Cesnavicius :roll:

Your Mission..if U Choose To Accept....
Is to help me figure out a scrolling game issue.
I have done a few games before, but never one that requires side scrolling. So I need this boards expertise. If you would be so kind.
Heres the scenario....your a gangland member (back in the good old days..1920s-30s) and you are making a hit on rival gangs. You are in the car and its closer to the screen..almost transparent. You control the car by pushing the left and right arrows...this speeds u up and slows u down as well. You are constantly moving forward tho..so no going and reverse and capping anyone you missed the first time. You control the gun with the mouse and its simple cross hairs.
Now...what type of scripting or symbol nesting will I need to do to get the background to scroll along with the cars movement? Lets say I have a guy shooting a tommy gun at you standing on the corner. How do I get him to scroll along with the BG rather than have him just sitting there looking like a dork while the bldgs. move right by him.
Any answers you guys give will be helpful.
Thanks in advance.

How To Choose Which Picture To Be Displayed?
Does anyone know how to display a random picture on loading of a .swf file? I would like to do this by setproperty method where you can set the picture's x and y coordinates but it only seems to work with buttons' on (press) event. has anyone done similar things before?

No Target Path To Choose From?
I am a total novice running through a "basics" actionscript tutorial.

I am trying to add button actions to shift a movie in the library. My problem: when i go to insert target path the only movie for selection is _root. I have a clip eyes in another layer but cannot select it. If I type in the path as I think it should be. The debugger tells me the object does not exist.

What am I doing wrong?? It must be simple as I have only created one scene, 4 graphic layers, a navigation layer and an actions/labels layer.

Any Ideas would be greatly appreciated. I can get the whole movie to shift but not the clip I want to shift.

Thanks in advance I've read many tutorials without success.

Mike

?Choose What Appears In The Next Scene?
In scene 1, I have 10 check boxes (From the Flash MX components). In scene
2 I have a list of 10 independent lines of text.

How can I link the check boxes in scene 1, to the 10 items on scene 2, so
which ever checkboxes you select will deterimine which of the 10 items
appear in scene2?

RPG-choose Ur Path Game
Hey
My names Dominic and what ive been trying to do for years is make a choose your path RPG game but i also want to have items that u can pick up-Look at this game http://www.newgrounds.com/portal/view.php?id=81945 <<thats EXACTLY what i want to know how to do. please either post a tutorial or a link to a tutorial or email me at mistasmijen@yahoo.com please, i am begging u, ive wanted to know how for so long but just couldnt figure it out

Thanks soooooooo much you have no idea!
®Dominic®

Choose Random Variables
I want to know an easy way for flash to randomly select variables from a pre-existing list. For example randomly select x,y, or z? Any ideas please (for Flash 5)

Randomly Choose Scene? (mx)
Is it possible to have one scene and there have a button that chooses randomly from 5 different scenes? - And makes sure that you don't get the same one again?
And if you tried them all takes you to a 6th one?

If this makes any sense - does anyone have any idea how to do it?
I'm kind of a newbie, so nothing too complicated
Please......

Help ME Choose Books I Am New To Flash...
Hi, I am very new to flash... in fact I have zero expierence with flash. But I would really like to learn... So I wanna get some books on it, but am having a hard time choosing. I know for sure that I am going to get the swift 3d foundation book... but thats not for flash... I am considering getting the flash mx bible and the flash mx actionscript bible... as well as the ADGS2. Are these good choices? The only books I have on web design are "Learning Web Design" And "Web Design in a nut shell" both very good books... I also have fireworks mx visual quickstart guide... but I don't like it... And I'm pretty good with fireworks anyways... So anyways, will those flash books be good choices? Or do you people have better recommendations? Thanks A lot

I Want To Choose First Number From 3 Numbers?
I hope someone can help me out . Actually I’m beginner in Action Script. I want to create Educational software for my School project.

I want to choose first number from 3 numbers that I insert randomly from input text box

Example:
Input Text Number = 345

I want to take first number, in this example are 3. So, what action script that I need to use to take this number?

Thanks for your help, really appreciated.

Choose Scenes To Play?
I have a question about something that I know can be done, I just have no idea how to do it! I have a flash that is split up into 6 scenes. I need to develop a menu in the beginning that gives you a list of the 6 scenes (topics) and I need the user to be able to choose as few or as many as they wish to play and loop. So if the user chooses #3 and #5 i need 3 and 5 to play over and over. Does anyone have any idea about how to do this? I am fairly experienced with flash but not so much with complex actionscript. I am using Flash MX 2004. Thanks in advance.

Susan

Choose An Object From A Group
Hi,
If I had four movieclips on the stage(lets say 4 balls) and I clicked on one of the balls, how would I make that a signal to make the other 3 balls move off the stage?
I made a funtion like this:
MovieClip.prototype.ballClick = function(Xmove) {
if (Clicked) {
_root.ball2._x = _root.ball2._x-Xmove;
_root.ball3._x = _root.ball3._x-Xmove;
_root.ball4._x = _root.ball4._x-Xmove;
}
}
...But of course this would not work if it was any other ball then ball than number one. How can I generalize this so it can work for all four balls?

Thanks
JAy

Senior Members Etc Choose MX
How come most of you use MX as opposed to 2004? Usually people flock to new versions of software yet people seem to tiptoe around 2004. I've started trying to use 2004 and with the lack of normal mode (on AS) i've been struggling. Is MX better to use? Your opinions please!

Thanks

Dynamically Choose Property
hi, I'm trying to make a versitile function that will make an object move a direction or change size. The function has two parameters, "target" and "property"

so the idea is if I wanted to set, _root.bar._width = "20";
I would call the function and set the perameters, target="20", property="_width"

so far I am having trouble with the syntax to set the property, I was thinking (when property="_width") it would be something like this:

_root.bar.[property] = target;

Any ideas??

thanks in advance
-Noah

Need Users To Choose Options...how?
Hello, this is my first post, but i have been lurking these forums for months getting lots of help.

I was wondering if someone cold help me or point me to a good tutorial.

Here is what i want to do... (I really dont know where to start on my own)

I have a site where people need to select options for their custom product. How can I make it so when they select option, the selection is added to a list on the right side with a price, and the price totals at the bottom.

If anyone can help, then i have a further question... how do i make it exclusive (so they can only add one option from each category to their choices). Then, send choices to me.

Here is my site so far .... www.PokePokerTables.com
im pretty excited about what i have done but still have lots to do.

If you do take a look, the area where I will be doing it is the "table options" page, the main area they can choose options and the small area to the right is where the options will total.

So just to clarify again, there is a base product (a poker table) and they need to be able to add the options/add-ons they want, and add the cost to a base price.


Thank you so much in advance, and I look forward to your responses! This is my first flash project (I use mx 2004) and i have been literally learning each step as i go.

Randomly Choose Next Number Up Or Down?
hi guys!


does anyone know how i would generate a random positive or negative?

say i had:

theNum = 5;

how could i randomly generate a possibility of it going up or down by one number for eg either 4 or 6?

thanks

[F8] Eyedropper To Choose Color
hey guys,

this is a pretty rudimentary question, but i'm on a mac using flash 8 and when i used to draw with flash, i could use the eyedropper tool to pick the color from a photo on the layer beneath the layer i was drawing on. now when i use the eyedropper color and there is nothing on my current layer, it just defaults to white.

also what would be way more awesome than pressing 'i' for the eyedropper, getting the color, and then pressing, 'b' to go back to the brush would be if it were like photoshop where you just hold down the option key long enough. is there a shortcut like that?

thanks,
Josh

Choose The Movie You Would Like To See Made
So here is the problem I have to figure out and I can't even think of where to start.

I'm going to have 2 columns with 3 videos in each one.
The user can click on a video from each column and then see them combined into one streaming video.

I figure I can make an flv of every combination possible. I just need to figure out how to go which video depending on which boxes you've clicked.

Any suggestions? Are there any true flash Macgyver out there?

How Do I Choose One Object From An Array?
I don't want all the stars to fall at once I want to be able to choose which one falls, how do i do that?

ActionScript Code:
public function makeStars(){
                stars = new Array();                       
                //create a grid of bricks 5 by 8
                for(var y:uint=0;y<10;y++) {
                    for(var x:uint=0;x<8;x++){
                        var newStar:MC4 = new MC4();
                        newStar.x = 60*x+65;
                        newStar.y = 20*y+50;
                        newStar.speedY = Math.random() * 5 +2; 
                        addChild(newStar);
                        stars.push(newStar);
                    }
                }}
            function enterFrameHandler (e:Event):void {
                //Loop through the numbers
    for (var i = 0; i < stars.length; i++) {

        //Update the y position
        stars[i].y += stars[i].speedY;
    }
    }

No Flash? Choose Html
anybody know of good websites who provide the choice between flash and html versions?

It may be big multinationals...
robin

AS Conversion - Not Sure Which Forum To Choose
Sorry if this is posted in more than one forum as I'm not sure which one would be ideal.

This code works fine in Flash player 6 but not in 5. Could somebody lend some quick coding fixes to make it compiant? Thanks


speed = 5;
afoodaffair._alpha = 60;

afoodaffair.onRollOver = function ()
{
this._alpha = 100;
}


afoodaffair.onRollOut = function ()
{
this.onEnterFrame = function ()
{
if (this._alpha > 60)
{
this._alpha -= speed;
}
else
{
delete this.onEnterFrame;
}
}
}

Choose From Array Of Containers?
I need my script to randomly choose between the 3 containers on the stage. Here's what I have so far, but I'm not sure what to put in place of the "box" section of the script.

Code:
var items:Array = new Array("artExchange", "austinVentures", "axcelis");
var containers:Array = new Array("1", "2", "3");

function randomImage() {

nr = Math.floor(Math.random()*items.length);
ct = Math.floor(Math.random()*containers.length);

box.attachMovie(items[nr], "thang", 1);
}
Where I'm confused is how to change my target container which is currently "box", to the call the random variable "ct" instead.

Code:
box.attachMovie(items[nr], "thang", 1);

How To Choose Between Sound Devices
On my SuSE Linux sytem I have two sound devices: the original sound card and an USB device (Xitel HiFi-Link).
Both devices are seen by the system (/proc/asound/cards and /proc/asound/devices) and can be used by ALSA (using hw:0.0 resp. hw:1.0) or by OSS (via /dev/dsp resp. /dev/dsp1).
How to configure Flash (it now uses the original sound card) to use the other device?

Choose The Codec When Publish ?
Hi,

I am publishing to a server videos recorded from people's webcam and I would like to know how I could set it so that it encodes with Sorenson Spark instead of on2 VP6.

Thanks,

Jeremy

Choose From Array Of Containers?
I need my script to randomly choose between the 3 containers on the stage. Here's what I have so far, but I'm not sure what to put in place of the "box" section of the script.

Code:
var items:Array = new Array("artExchange", "austinVentures", "axcelis");
var containers:Array = new Array("1", "2", "3");

function randomImage() {

nr = Math.floor(Math.random()*items.length);
ct = Math.floor(Math.random()*containers.length);

box.attachMovie(items[nr], "thang", 1);
}
Where I'm confused is how to change my target container which is currently "box", to the call the random variable "ct" instead.

Code:
box.attachMovie(items[nr], "thang", 1);

Use XML To Choose FLV/MP3 For MediaPlayback Control
As I am somewhat new to Flash I still haven't gotten down how to properly use XML, etc., and how to apply that data to controls in Flash.

In peticular, I'd like to know if it's possible (and how, of course) to choose the FLV/MP3 to be played in a MediaPlayback Control (Flash 8, Pro) from an external XML file, or some such.

The closest thing I found was in the LiveDocs, however I know so little that I don't know how to implement it, or even if it can be used externally, or is actually part of ActionScript. It's found @ http://livedocs.macromedia.com/flex/...n/00000445.htm

Which shows this:


Code:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" >

<mx:VBox>

<mx:MediaPlayback contentPath="http://myhost.com/media/MyVideo.flv"

height="400" width="400" controllerPolicy="on" controlPlacement="left"

autoPlay="false" />

</mx:VBox>
</mx:Application>
Can anyone help me out? Thanks much, and thanks for your time... I know I'm wordy.

Four.

Help ME Choose Books I Am New To Flash...
Hi, I am very new to flash... in fact I have zero expierence with flash. But I would really like to learn... So I wanna get some books on it, but am having a hard time choosing. I know for sure that I am going to get the swift 3d foundation book... but thats not for flash... I am considering getting the flash mx bible and the flash mx actionscript bible... as well as the ADGS2. Are these good choices? The only books I have on web design are "Learning Web Design" And "Web Design in a nut shell" both very good books... I also have fireworks mx visual quickstart guide... but I don't like it... And I'm pretty good with fireworks anyways... So anyways, will those flash books be good choices? Or do you people have better recommendations? Thanks A lot

What Frame Per Second Should I Choose For Best Quality
What frame Per Second should I choose for best quality????

Copyright © 2005-08 www.BigResource.com, All rights reserved