Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd Flash Problems.... 1

Status
Not open for further replies.

TheJhereg

Programmer
Nov 12, 2001
31
0
0
US
Okay, these are going to sound a bit weird....

Problem #1: Any idea of how I can find the color of the pixel underneath the cursor on mouse click. I was hoping there was a funciton call that simply grabbed and returned the pixel color.

(This is for choosing colors from a color pallet. I was hoping to use an image or a fade and collecting the color by pixel. If this one's a no, I'll create about 100 objects, each with a different color)

Problem #2: Is is possible to import a .jpg image at runtime.

(I'm building a site for a client. They want to build slideshows using flash effects. However, they want to simply drop several files into a folder (eg. 001.jpg, 002.jpg...) and have the slideshow construct itself. Doing this is pretty easy, if my movie can import jpg's at runtime. Only workaround I can think of on this one is to make the client purchase Flash, and build one image movies and name them like above.)

Anyway, thanks for any help you can give me on this one...
The Jhereg
=~=~=~=~=~=~=~=~=~=~
I never lie.
I'm building a reputation for honesty so I can blow it when something big comes along... This ain't it.
 
Not sure about question 1, but question 2 comes up all the time an the answer is :

YOU CAN'T USE OUTSIDE OBJECTS WITHOUT GENERATOR (OR ONE OF IT'S EQUIVILANTS) Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Big Dave...
No need to shout! Not a tipmaster's ordely conduct! LOL
TheJhereg,
Generator = big bucks!
You might want to have a look at this free equivalent:


Regards,
wink4.gif
ldnewbie
 
Sorry for SHOUTING, but this question comes up all the time. Someone should write an FAQ and then people could be pointed to the answer wherever necessary. Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Thanks Oldnewbie : )

I'll give it a look! The Jhereg
=~=~=~=~=~=~=~=~=~=~
I never lie.
I'm building a reputation for honesty so I can blow it when something big comes along... This ain't it.
 
Two things about forums...

1- Same questions keep coming up... Eventhough it might be answered 2 threads below! Just have a look at "closing a popup" on the javascript forum!

2- A FAQ might help, but you'll have to direct the user to it, because most users don't bother to search them anyway.
Having thus answered the question anyways, might as well do it politely, or not bother to even answer the question in the first place! Saves bandwidth if nothing else!

Regards,
wink4.gif
ldnewbie
 
To answer question 1...

Picking up colours by pixel isn't possible in Flash. You can do what you want, kind of, using the Color() object which allows you to interrogate a movieclip and find out its colour values. There are two methods of this object which would give you results that you could use:

getRGB(); and getTransform();

First you need to set up the object for your clip:

paletteColour= new Color("palette1");
paletteColour.getRGB().toString(16);
trace(paletteColour);


...which would return the hexadecimal value for the clip you chose.

getTransform() returns colour offset values for red, green, blue and alpha rather than a straight RGB value.

You'd need a way to select the clip in the first place (hitTest() or using invisible buttons perhaps) and have some sort of dynamic naming convention so that you could retrieve the instance name of whatever part of the palette your mouse was over.

Not easy but it is possible.
 
Yeah, I didn't figure it'll be much fun.

I think I'll take the easy way out and use windows common controls (VB App) for a color picker. It's there, it works... <shrug> Thanks for your help!

The Jhereg
=~=~=~=~=~=~=~=~=~=~
I never lie.
I'm building a reputation for honesty so I can blow it when something big comes along... This ain't it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top