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








Get Colour At X And Y


I am wondering if it is possible to get the colour of a pixel at the mouse coordinates. I tried using BitmapData but I can't seem to get that to work. The colour data I want is on a MovieClip and I'm not sure if BitmapData supports that. Any help is appreciated.




ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 01-25-2007, 06:34 PM


View Complete Forum Thread with Replies

Sponsored Links:

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......)

View Replies !    View Related
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:

View Replies !    View Related
Flash Colour/ Javascript Colour
Can anyone over here help with the following...

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

View Replies !    View Related
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...

View Replies !    View Related
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

View Replies !    View Related
When Is A Web Colour Not A Web Colour?
when it's in flash apparently.

what's going on with the colour shifting?
how do i get around it?

and why is it when i import an alpha channel (.png)
it actually has a really light background?

what can i do? this looks really lame now.

please help.

View Replies !    View Related
Colour Fx
How do you get colour effects like Fire and Sky on Flash?

View Replies !    View Related
Colour ?
Hello ,
How do you have a picture or a button that when you move the mouse over it ,it changes colour , like it goes brighter or darker or it fades away.

View Replies !    View Related
Colour
and now that we have buttons and scripts floating all over the place, where on earth would you start writing a script to change the colour/alpha of the second movie clip when you curser over the first ???
drive me round the twist this flash stuff : )

View Replies !    View Related
Colour Changes By Day
Hello all,

I'm new to the forum - thanks in advance for any help.

I have an idea, but so far that's all it is.

I'd like to have a flash animation, with my logo, a small animation and...

I'd like the background of the flash file to change depending on what day of the week it is.

E.G.

array
If today = Monday, background colour = blue;
" " = Tuesday, background colour = green....

and so on.

Any help is much appreicated.

After that, I'd like to do the same with Javascript, but thats for another section.

Dan

View Replies !    View Related
AS Colour Changes.
I need to be able to change background/object colour/tint with keyboard inputs.

I have already figured out the AS for making keyboard input change the alpha of a given object at various increments, but now i need something similair with the colour of an object.

Is there an AS way to do this? Or am i going to have to setup a network of variables and movie clips?

Cheers

View Replies !    View Related
Colour Help
this wokrs just fine for me, but i can't change the 8 digit color there as I wish. Like; i cant make it white, or any specific color. I've tried " couleurCadre='#FFFFFF'; as in Java, but not working. here : couleurCadre = 90000000; this 90000000 is some kinda dark blue, I can make it black but not white. please help :)

onClipEvent (construct)
{
cheminPHP = "php/size.php";
cheminPhoto = "/";
couleur = 0;
couleurBar = 16777215;
couleurText = 16777215;
couleurCadre = 90000000;
alphaCadre = 100;
speed = 25;
}

View Replies !    View Related
MC. Colour
Hi Is there any maner so I can change a MC colour ( background ) for example in the 1st lint to have a red button then in the 2nd to have blue buttons!!


thnx
Gllanci

View Replies !    View Related
Colour Troubles
ok guys me again can u help me?

what i want is.....well ive got like three buttons all diferent colours and when they are pressed i want them to tell a movieclip to change to the same colour is there any script where you can say like

onmouse down tell target (whatever) to use the RGD of me

if you know what i mean

does anyone know a script for that and can u please tell me it

thanks guys

PHENIA

View Replies !    View Related
COLOUR CHANGES ACROSS SCENES
I have built a site and included the option to change the backround colour with buttons. However, I am not that good at scripting and need to know how to keep the selected colour when I change scenes (it goes back to the first col) Any help would be appreciated.

View Replies !    View Related
Colour Problem
My problem is that i use different colour for button. After it mouseover it all change to #00ff00 colour but I need it to change back to original button colour and not #ceedc4.

Look for
shpcolor.setRGB(0xceedc4);

-----------------------------------------------------------
Below is my code:
-----------------------------------------------------------
function mouse_event (shpid, action) {
this.shpid = new String(shpid);
var i = shpid.slice(3);
if (action == "mouseover") {
tellTarget (mc6.mainmap) {
shpcolor = new Color(shpid);
shpcolor.setRGB(0x00ff00);
}
_root.UC.news = _root.petlist[i].firstChild.nextSibling.nextSibling.nextSibling.fi rstChild.nodeValue;
} else if (action == "mouseout") {
tellTarget (mc6.mainmap) {
shpcolor.setRGB(0xceedc4);
}
} else if (action == "mousepress") {
shopurl = _root.petlist[i].firstChild.nextSibling.nextSibling.firstChild.nod eValue;
fscommand ("openWindow", shopurl);
}
}

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

View Replies !    View Related
Colour Problem
Hi,

Could you please help.....

I have assigned a hex color to a variable and fed this to a
movie clip using new color (variable) and then setrgb etc.

This changes the color of my mc but all i want to change is the Fill color or background not any text or other stuff on the same instance. Is this possible without having to layer all of my text etc....

The code used is as follows on an instance of change ........

onClipEvent (load) {
ToColour = new Color(change);
ToColour.setRGB(0x003399);
}

cheers

JugLugs

View Replies !    View Related
Cursor Colour
I have aform inmy flash movie,but the back gorundis black with white text.

The problem is that you cannot see flashing black line telling where the cursor is (because its blackaswell)

Can the color of this be set?

Thanks In advance

View Replies !    View Related
Colour Looks Grainy
My nav bar in my flash movie looks cool on my pooter, but its backgournd comes up grainy on the nasty ones the university has in the public computer rooms.

Is this cos my colour is not web safe, or is it cos it's got an Alpha effect on it?! I have to change every #@**P@~ symbol in every movie now so I don't wanna get it wrong again!

View Replies !    View Related
I Need A Ttraparent Like Colour
I was looking a movie done by some one else. In it he created a button that had a dotted like transparent colour. I know he did not add any effects to it because it woul showed up when I look at the effects added to the instance.

When you place it over another instance it looks like it changed colour. It is kind of hard to explain. I am willing email a copy of the instance if you guys do not understand what I am saying.

How can I get that!!!

Thaanks buddy

The Great karlzoe

View Replies !    View Related
Background Colour Should Be Nothing
I'm pulling out my freshly streaked locks in an effort to remove this bloody light green background from the swish sprite I imported into FrontPage. How can I get rid of it? In swish the "background" colour I have selected to work a simple text sprite on is "white"... when I import it into Front Page, my sprite works just fine, but I have a NASTY GREEN BOX behind it... HELP. I have tried deleting "bgcolour" in the html but this turns the box white and deleted my text sprite altogether...

View Replies !    View Related
Changing Colour
Can anyone tell me how I can gradually change the colour of a clip from one colour to another using A/S? I need to be able to calculate the hex values in a series of steps from one to the other.

Any help will be much appreciated

Thanks

View Replies !    View Related
Loss Of Colour
When importing PSD files from Photoshop the colour output is different. What format can you use in Photoshop to ensure the same colour output in Flash? I am using Photoshop 6.

View Replies !    View Related
Scroll Bar Colour?
I've noticed that alot of sites have the right hand side scrollbar a different colour. Does that make sence? Could anyone point out what I need to make mine a different colour.
Many thanks for any thoughs

View Replies !    View Related
Colour Change
I need help. I have a scene where the viewer picks a colour for an object. I want the object to be the colour they picked in the next scene. what is the action script. can anyone help please?

View Replies !    View Related
Change The Colour Of A
I used this code to change the frame of my movie depending on the time of my PC clock, now I want to change the colour of a "Graphic" using the time on my clock.

How do you tell a "Graphic" to alster it's RGB values?

mydate = new Date();
days = mydate.getDay();
month = mydate.getMonth();
day = mydate.getDate();
year = mydate.getFullYear();
//
if (year == 2002 && (month == 4 || month == 5)) {
if (month == 4 && day<27) {
tellTarget (stages) {
gotoAndStop(1);
}
}
if (month == 4 && day == 27) {
tellTarget (stages) {
gotoAndStop(1);
}
}
if (month == 4 && day == 28) {
tellTarget (stages) {
gotoAndStop(2);
}
}
if (month == 4 && day == 29) {
tellTarget (stages) {
gotoAndStop(3);
}
}
if (month == 4 && day == 30) {
tellTarget (stages) {
gotoAndStop(4);
}
}
if (month == 4 && day == 31) {
tellTarget (stages) {
gotoAndStop(5);
}
}
if (month == 5 && day == 1) {
tellTarget (stages) {
gotoAndStop(5);
}
}
if (month == 5 && day == 2) {
tellTarget (stages) {
gotoAndStop(5);
}
}
if (month == 5 && day == 3) {
tellTarget (stages) {
gotoAndStop(6);
}
}
if (month == 5 && day == 4) {
tellTarget (stages) {
gotoAndStop(7);
}
}
if (month == 5 && day == 5) {
tellTarget (stages) {
gotoAndStop(8);
}
}
if (month == 5 && day>5) {
tellTarget (stages) {
gotoAndStop(8);
}
}
} else {
tellTarget (stages) {
gotoAndStop(8);
}
}

View Replies !    View Related
Nice Colour..
was wondering if anyone knew how to make a MC change colour
dynamically? say from white to orange, when the user rolls over it and back to white again when the users rolls off it.

have done it using setRGB but i would rather have it so it eases in and out... my code is this...


Code:
onClipEvent(load){
buttonColor = new Color (this);

}

onClipEvent (enterFrame) {
if (_root.myColor5) {
buttonColor.setRGB(0xFF3300);
}else .. . . ... blah blah..



any help would be rewarded with one of those toys you get in a kinder egg... on joking..

thanks..

View Replies !    View Related
.txt Text Colour?
Hi there flash gurus

I usually create flash sites that get large text areas
from .txt documents, that way my clients can usually
change/add text without needing to open the .fla file.

Is there any way to assign colours in the .txt itself
(i.e. a red coloured text header)?

Thanks! Greetings!

View Replies !    View Related
Colour Changing
hi all,
I have three buttons and one rectangle which is blue, when button 2 is pressed I want the rectangle to fade to red and when button 3 is pressed the rectangle to fade to green...and so fourth
thanks,
tom

View Replies !    View Related
Colour Morphing
i just started a new site, and its taking longer then i expected. i want the background to change colour when i click on a link to a different section, and depending on what page its going to will dpend on the colour.

so this means i need 4 or 5 backgrounds, and the colours morphing from each on to each other. this seems like it will take too long how im doing it, manually in one movie. is there a quicker, easier way to do it?

thanks a lot.

View Replies !    View Related
Colour Morphing
colour morphing
i just started a new site, and its taking longer then i expected. i want the background to change colour when i click on a link to a different section, and depending on what page its going to will dpend on the colour.

so this means i need 4 or 5 backgrounds, and the colours morphing from each on to each other. this seems like it will take too long how im doing it, manually in one movie. is there a quicker, easier way to do it?

thanks a lot.

View Replies !    View Related
Colour Tween?
could someone please direct me to a tutorial on how to do colour tweens. or even better give me a breif description on how to do them. i've searched macromedia.com and here but so far have had not joy.

thx, squid.

View Replies !    View Related
Input Txt Colour
Hiya

I have created a mail form and am trying to load it into my main swf, which I can do, the only trouble is the input txt does not have any colour to it when typing in the fields. It works on its own its just when i'm loadin it in to my main movie.

can anyone tell me why?

View Replies !    View Related
Bg Colour Change
How do you change the bg colour during a scene.

Ex when i play my movie i wnat the bg colour to start off witha white bg then change to a black bg in the same scene how do I do that.

View Replies !    View Related
Colour Change
hello again!

i have another questions for the minds of the great out there. i have a movie and above that movie i have a 50% alpha blue toned square that colours the whole movie. what i am after is a drag bar that chnges the colour of this box, hence changing the colour of the overall site.. . .

can this be done, and if so, please could you help...

many thanks

tasvin

View Replies !    View Related
Colour Question
Ok - i am trying to make a fire like effect (candle) - unfortunately i am not sure how to make a different radial colour type on a movie clip symbol???? any suggestions?

View Replies !    View Related
Colour Picker
Hi

While trying to sort out a car colour picker I stumbled on to this example (that is attached) and I was wandering how would be this converted to work on any level , like for example if I placed these frames into another movie instance - empty clip called "car". The problem seems to be with the sliders , is that to do with "this" used to refference the sliders ? Um if anyone understands the concept please let me know. Also would anyone know how they created the car so it looks like it's out of glass and it's easy to manipulate it's colour.

CHeers

View Replies !    View Related
Menu Using Colour
I am trying to create a very simple menu bar - using only the colour of the buttons to indicate where the user is on the page.

Confused? I have a list of names - when the user presses one name it should change colour - and stay that colour untill another button is pressed. How do I achieve that?

View Replies !    View Related
How Am I Going To Do This? (colour Control)
Hello all, well here is my problem...

so try to keep up as im not very good at explaining...


imagin a background colour (blue). through the middle is the navgation (a row of buttons)

each button goes to a different section on the site whch is represented by a colour.

the animation i want is...

when a button is clicked, a colour block (the colour of that section) drops down from the button then expands to fill the bottom half of the page in that colour...

then when the next button is clicked, the same thing happends on top of the previouse colour. get it??

my prob is..

if i do the animation by key framing, then if have it goes back in the time line
say going from a contact page to home then the backround colour jumps back to what the previous colour for that section was, what i wanted to happen was from the colour to drop down in the block (over the top of that section) then expand to fill like before.

I was thinking about loading in swf's on top of each other but it would knock out the previous level (colour) before the new one had animated.

so im guessing either i animate everything for each button (so each combination is animated, very long winded) or there was some guru action scripter out there who could help me.

HHHHEEEELLLPP!!!

thanks guys, if you need any further explaination then just ask

sorry for any spelling mistakes as im not gonna re read this to check...submitting now!

edit, i did check in the end as what i had wrote didnt make sense

View Replies !    View Related
How To Set Background Colour?
I have 10 buttons for changing the background colour of a movieclip. Movie clip is a square with linear gradient. When I click 10th button I want to have the movieclip retain its original linear gradient colour, but right now it turns to some solid colour even though I have mentioned the RGB value of the linear gradient.

On the button I have
on (press) {
colour.text="#A0C4EB";
}

On the frame of the main timeline I have
myColor = new Color(colour);
c1.onRelease = function() {
myColor.setRGB(0xA0C4EB);
}
Is this right?
How to make the same linear gradient colour appear?

View Replies !    View Related
How Do I Get RGB Colour Numbers?
I want to change the colour of a movie.
I'm using the setRGB function.
But... the problem is that I've got no idea how to get the numbers of the colours!?

How do I go from what I get in the colour picker, a number like #CC64CE to be a number like 0x232457?

Any help would be appreciated.

Thanks.


Jam

View Replies !    View Related
Colour Transition ?
Hi,

can someone tell me how to gradually fade say over 3 seconds a movieclips colour from its colour to white and vice versa.. using actionscript

Thanks in advance
Dave

View Replies !    View Related
Background Colour
Hi all,

Just wondering if it was possible to change a background colour halfway through a movie, tried using keyframes on my background layer but can't get anything to work...

Any help greatly appreciated ...

tyrone

View Replies !    View Related
Jpeg/gif And Getting It's Colour
Is there a way to select one colour region from a jpeg/gif file using actionscript,only?

what i want to do is that when the user choose this colour region, there might be some kinda action associating with it. like diming other colour region.

View Replies !    View Related
Scrollbar Colour
hi how do u change the scollbar colour using Javascript.

thanx.

View Replies !    View Related
Colour Theme
Hi,
On my web site i have four different colour themes.
The default theme is red.
I want when someone chose another theme for ex. blue, when he visit my site again to be displayed the blue theme.
When he chose that theme, to be remembered for him.
I don't know how to do that, i think this will use cookies.
Help?
Thanks.

View Replies !    View Related
Colour Fade
Without using tweening is there a code to tell a button to fade into a new colour when rolled over

on (rollOver) {
setProperty(??????????);
}

but I want it to fade into another colour, not just turn another colour, I can do this by making the over states of my buttons into movie clips but I have like 50 buttons that I want to use this on.

View Replies !    View Related
HOW Can I Fade From One Colour To Another ?
Hi, I need to change the colour of different MC's which is no problem.. but can someone tell me how i fade from one into another ?

Im going to have 4 different colour backgrounds so when you click a button i need it to fade into the new colour.. so each mc could possiblly fade into anyone of the other 4 at anytime,

Thanks

View Replies !    View Related
Passing Colour From XML
Not had much luck with my previous XML problems so far. Hope someone can help with this one:

I'm trying to create a textField for each of my xml items, get the colour value from the xml file for each item, convert the colour value from #000000 to 0x000000 format, assign the converted value to it's relevant colour textField, and use that value to change the colour of a banner, when I call for it.

Seems that the colour value is not being passed (thus always returns as black). This is what I've got:
code: for (i=0; i<imagesTotal; i++) {

picHolder = this.firstChild.childNodes[i];
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);

...

thumbHolder.title = picHolder.childNodes[0].firstChild.nodeValue;
thumbHolder.detail = picHolder.childNodes[3].firstChild.nodeValue;
thumbHolder.colour = picHolder.childNodes[4].firstChild.nodeValue;

/* Create textfield with colour value. */
_root.createTextField("colour"+i, 0, 0, 0, 0, 0);

/* Convert #Color to 0xColor. */
vCol = new String (thumbHolder.colour);
ColStr = vCol.slice(1, vCol.length);
_root["colour" + i].text = "0x" + Number (ColStr);

thumbHolder.image = picHolder.childNodes[2].firstChild.nodeValue;
thumbLoader = thumbHolder.createEmptyMovieClip("thumbnail_image" +i, i);
thumbLoader.loadMovie(picHolder.childNodes[1].firstChild.nodeValue);

...

thumbHolder.onRelease = function() {

_level0.variables.currentImage = this;
vImage = new String (_level0.variables.currentImage);
_level0.ImgStr = Number (vImage.slice(28, vImage.length));

...

Newcol = new Color(_level0.banner);
Newcol.setRGB(new String (_root["colour" + _level0.ImgStr].text));


};

}

Your help would be much appreciated.

View Replies !    View Related
Colour Strings.
Say I wanted to have a textbox that when the user types in a hex value, the colour of something would be changed. What would I need to do so that the person wouldn't have to precede it with 0x? How would you make a hex value from a string is what I'm saying. For example, fix this up and I'll be happy, do what you think I'm trying to do.


PHP Code:




colour = "FFFFFF"
lineStyle(3, Color("0x"+colour), 100);

View Replies !    View Related
Set Colour Of Mc At Runtime With AS?
Hi!

How can I set colour of a mc at runtime with AS?

Thanks!

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved