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




Iaskwhy Help Again? SetTransform / SetRGB



iaskwhy,
Your code for randomly changing RGB is very clean and works well.

R = random(256);
G = random(256);
B = random(256);
colorHexString = R.toString(16)+G.toString(16)+B.toString(16);
colorhex = parseInt(colorHexString, 16);
myColor = new Color(this);
myColor.setRGB(colorHex);
gotoAndPlay(1);

Now I realize what I really need is the same thing to setTransform (the colors) instead. I tried modifying this one but I now feel like a moron...can't get it to work.
Thank you.



FlashKit > Flash Help > Flash ActionScript
Posted on: 04-01-2005, 01:30 AM


View Complete Forum Thread with Replies

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

SetRGB Vs. Color.setTransform
I'm a new user to Flash 5 and have thrown myself knee-deep into ActionScript. I have a 2 part question:

1) What is the difference between using setRGB vs. Color.setTransform? Why would anyone use the long-winded protocol of Color.setTransform when setRGB is so much easier? Granted, Color.setTransform does give you a finer degree of control, but is there anything more to it than that?

2) I'm having a problem changing the colour of a MC using a series of different coloured buttons buttons. I have a targetMC called 'colour' which is nested inside 't2x41'. I've tried both methods:

on (release) {
color = new Color(_root.t2x41.colour);
Color.setRGB(0x0000FF);
}

and...

on (release) {
color = new Color(_root.t2x41.colour);
colorTransform = new Object();
colorTransform = {ra:'0', rb:'0', ga:'0', gb:'0', ba:'0', bb:'255', aa:'100', ab:'0'};
color.setTransform(colorTransform);
}

Either way, when I test the movie, I'm only able to change the colour once. The movie starts, I click one of the colour buttons, it changes the colour as specified, I click another button, and NOTHIN'! Restart the movie, retest, same thing.

Any hints guys??

SetRGB Change To SetTransform
I'm very new to actionscripts and am tweaking a drawing/graphics creation script to fit my need. Bascially I want to do the following:

1. Have our user load 1 or more graphics
2. Give them the ability to change the color and save the design (currently this saves an XML file.

So here's my problem. I got the setRGB to work great but then realized that I couldn't clear out the color for some graphics (for example a user wants some to have color change and some to not) so I looked into setTransform which seems like it will rock. The problem is I can't seem to save the data correctly. I just get Object object in the xml.

here's how the setRGB worked
When a user selected a graphic:

var oColor = new Color(this);
oColor.setRGB(400000);

this.oColor = oColor.getRGB();

then when functions to write the xml is called:
node.attributes["oColor"] = elements[i].oColor;
The XML that's recorded is
oColor="400000"

This works great (and I would do this but I can't clear the color for some graphics)

So now I can get the setTransform to work similar to above by the following:
var oColor= new Color(this);
oColor.setTransform({ra:100, rb:255,ga:100,gb:255,ba:100,bb:255,aa:100,ab:0});

this.oColor = oColor.getTransform();

Kept the same code for writing the xml:
node.attributes["oColor"] = elements[i].oColor;

Note: The drawing/graphics app does show the color change and seems to function great until I save it which calls the write xml functions.

The actual xml recorded looks like this:
oColor="[object Object]"

I've tried tweaking the way that I setTransform to the following:
oColor = new Color(this);
myColorTransform = new Object();
myColorTransform = { ra: '50', rb: '244', ga: '40', gb: '112', ba: '12', bb: '90', aa: '40', ab: '70'};
oColor.setTransform(myColorTransform);

which again worked great but I can't seem to get the color transformation to save in the XML.

any help would be so greatly appreicated. or if you could direct me to a resourse that would be great.

Object object is really confusing me and while I've found posts that explain a bit more about getTransform...I'm still at a loss.

Thanks so much!
Leslie

SetRGB :: Reset Button From SetRGB
I'm setting up a nav with buttons so that when you click on a button, it's color changes with setRGB so that the color stays when it is not being hovered.

I'm trying to figure out how to reset it. I have a script going that will change it back to white using setRGB when another button is selected, but then I lose the actual rollover effect in the button.

Is there something like a resetObject or anything?

I'm in MX'04 and have attached a file.

Thanks,
C.

Hey Iaskwhy...
hey i like your website www.flashbax.com alot!

the movable window box thingy effect is well gd

the old site was a bit.... ahem* soz, great new site tho!

Iaskwhy
Argh! remeber my post yesterday with the attachmoive moive problem, well it works on a button press, howevere know i cant get the postioning correct

your tutoiral says:


Quote:




Position the Movie Clip...
To position the movie clip when it loads, open the clip to edit. Make a new Actions layer, or use the one already there. In the first frame of the Actions layer, add the code to position it once it is loaded to the main stage. Anything loaded to a Flash movie always uses the top left corner as the target point, so you must visualize where the rest of the movie will sit when you determine this point. The code goes in the first frame of the Actions layer, above anything else that may already be there and looks like this:

this._x = 100;
this._y = 100;

When the movie clip loads, it's top left corner will sit at x 100, y 100 of the main stage. That's all you have to do.

This concludes the attachMovie tutorial. If you found it useful, or you found mistakes, or have suggestions, drop me a line here.






I messed with the numbers like, but doesnt move!! Argh!!

Iaskwhy... Can U Help Me?
I need to figure out the code for a "back" button on my site. i have an "about us" button linked from different pages and i need a back button to take the viewer to the previous page.
can u help?

Iaskwhy...
http://www.flashkit.com/board/showth...hreadid=616985

If you had checked carefully (post time), you would of noticed that the other post was the cross-post and should of locked that other one, not this original one...

And the proposed solution is only a workaround that would only work in this case and is not at all a gradient mask, which is, as you certainely know, yet impossible in Flash.
It would sort of be like using loadVars rather than Loadvars, and even when knowing it's an incorrect syntax, saying it doesn't matter if the syntax is wrong, it still works so I'll use it (and even suggest using it...) still!

1stBite / IaskWhy Help Please
On my main stage I applied this action:

myDepth=20;


I have buttons on the main stage which play different movies. each buttoncontains this similar action:

on (release) {
_root.port.swapDepths(_level0.myDepth=20);
_root.port.gotoAndPlay(2);
}

Now within' that "port" movie clip I have more buttons which I want to play another movie within the "port" movie. When i click the button from within the "port" movie the next movie does not show up. I assume that its playing, just not above the "port" movie. What do I need to do to make that movie come up front?

Thanks,

IASKWHY Please Continue To Help
You are right regarding the email form. Thats not the one I really want. I want something like this. Can you now tell me which part of php I should edit to fit my needs? I appreciate your patience.

Further Question To Iaskwhy
WOW, thanks for the quick reply! That was pretty cool!
I tested it with my movie, but it somehow seemed not to find the corresponding "if" for the "else" (?)
Erm... Where exactely do I have to put this code anyway? Which variables do I have to change?

This is the ActionScript you figured out for me:

code:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.moreinfo.nextFrame();
}
} else {
_root.moreinfo.prevFrame();
}


Thanks again for your help!

Iaskwhy-Symbol 10
Just a thought for Iaskwhy, If I was to put everthing like buttons and tooltips,on the ext swf, what actions would I use. For example, If the kart, fk_int actions are still on symbol 10 and the picture in the external swf has all the buttons, how do you code ea one to communicate to the flashkart.

Question For Iaskwhy And Other SEO Buffs
If you place text behind a .swf or other image so it (the text) doesn't show on the screen after the object is loaded (using CSS absolute positioning), do search engines use the text in their indexing or have they found a way to ignore it?

-Thanks

Thanks Davulf, Catbert & Iaskwhy
hey guys.

Just to say a big thanks for the help you've given me over the last couple of months! This is a really great forum!

I completed my first ever music video at 06:05 this morning, it was in flash and it was all thanks to you guys.

If you want, you can PM me your address and i can post out a cd of the final avi version all the way from sunny glasgow!

thanks again guys!

Barney Menu's Reloaded (iaskwhy, Oldnewbie)
okay... so you guys helped me out with one thing, but now I'm stuck with another thing

this is the thread I'm talking about
http://www.flashkit.com/board/showth...hreadid=426662

I want the barney menu (just as it did with "Verhaal" and "Personages") to go to a specific place in the movie when a specific button is rolled into the screen...
so when the user slide to eg. Gandalf I want the movie to go to the frame with label Gandalf and so on...

I've tried adding an If sttatement

Code:
If (targetx2 > ...){
targetx2 -= 75
gotoAndPlay("Gandalf")
}
but that only brings me to the targetx2 position of the last If statement...

thx again guys
damn, it's twice as irritating when your on a deadline...

Iaskwhy Gave Some Really Helpful Preloader Stuff, But Once Again I Got Questions :)
Hi,

I downloaded that dynamicload.fla the other day and it seems to be a really powerfull preloading tool. So I tried it to load an .swf (which is in the same directory with the dynamicloader.swf) of 7.81MB. however, I can't see any loading going on, it justs immediately and without any effort, loads the .swf on stage
Why is that?

Anyway I was wondering then if I even need a loader and I think you can help me out.
The thing is I'm making a promotional CD-ROM (which by the way is due in on the 17th ) The project will run from an .exe file ofcourse which contains a series of 4 different .swf's. A loading page,an intro clip, the main page and another swf that the main page loads in order to access a picture presentation. The most important question lies on the last one. Let's say that the pictures for the picture presentation.swf are included in the CD-ROM, so the pic. pres.swf loads all of them together on stage.
Well, do I need a loader or will the pictures load quickly since they're already on the CD-ROM?
Another thing is, do i need a loader to load the introclip.swf, the mainpage.swf e.t.c? Probably it's the same issue...

Pls reply asap. this is for my AS Design & Technology project. Due in on Thursday

Andreas

SetTransform
Is it possible to use .setTransform and have it fill in the object it is transforming dynamically with variables and loops?

I've tried it and it's not working.

Anyone?

This is what I'm starting with...

_level1.onetext.setTransform( { ra: '255', rb: redValue, ga: '0', gb: greenValue, ba: '0', bb: blueValue, aa: '100', ab: '100'});

_level1.twotext.setTransform( { ra: '255', rb: redValue, ga: '0', gb: greenValue, ba: '0', bb: blueValue, aa: '100', ab: '100'});

This continues to 'twentytext'

That's working fine.
For time saving and space saving I'd like to be able to put it into something like what's below.


while (numberloop<21) {
numbers = new Array("0","one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty");
numberloop = numberloop+1;
"_level1." + numbers[10] + "text".setTransform( { ra: '255', rb: redValue, ga: '0', gb: greenValue, ba: '0', bb: blueValue, aa: '100', ab: '100'});
}

SetTransform
What do I have to import to use it? I want to manipulate some color properties of objects, but I don't know what I have to import to make setTransform work.

Edit: I got it to work, but now when I try to use it I get a runtime error:


Code:
TypeError: Error #1006: setTransform is not a function.

SetTransform
Is there any way into making the color dynamic?
e.g.
color = ra:100,rb:-28,ga:100,gb:-28,ba:100,bb:-255,aa:100,ab:0;

I tried that and got error.. I tried color = {ra:100,rb:-28,ga:100,gb:-28,ba:100,bb:-255,aa:100,ab:0};

and

myColor.setTransform({color});

Any way of doing this otherwise?

SetTransform
hi!
help me about "my_color.setTransform" with an example.thanks

Formula For SetTransform?
Hey guys, I want setTransform to control the color of a MovieClip as I move the mouse; It works okay but I can't control the colors -

yoyoyo = new Object();
yoyoyo.ra = 0;
yoyoyo.rb = _root.r;

etc....then

_root.r = Math.abs(this._x);
_root.g = Math.abs(this._x);
_root.b = Math.abs(this._x);

Anyway, supppose for example I want the mc to fade through the rainbow from red to purple...I assume there's some sort of calculated formula/something out there, can anyone help me? Thanks. Love, J_red

Restore Look After SetTransform?
Hi all,
I'm tring to restore the original look of a movieclip, after it's been changed with a setTransform statement.

I thought this would do the trick (no offsets, or color values, and an alpha of 100), but it simply makes the movieclip black:

colRestore = new Color(this)
objTransform = new Object()
objTransform.ra = ''
objTransform.rb = 0
objTransform.ga = ''
objTransform.gb = 0
objTransform.ba = ''
objTransform.bb = 0
objTransform.aa = 100
objTransform.ab = 0

colRestore.setTransform(objTransform);

(Using the 'getTransform' statement and store the result in a 'restore' variable before applying any transformation doesn't do the trick.)

Any ideas?
Thanks!

Color With SetTransform
heya

does anyone know how to make the colors orange, purple, cyan, teal, etc. with the setTransform action? i'm not sure how to convert the RGB values to percentages...thanks!

SetTransform Function
Can I create a function that encapsualates the following:

myColourObject1 = new Color(FACE1);
TransformObj1 = new Object();
TransformObj1 = {ra:'100', rb:'150', ga:'75', gb:'200', ba:'20', bb:'188', aa:'50', ab:'255'};
ONE.onRollOver = function() {
myColourObject1.setTransform(TransformObj1);


I have an image called FACE2
and a button called ONE

Although I would like to use the same function on a sequence of button image combinations.
examlpe:
button TWO would change the ra, rb, etc. of image FACE2.

Can I Cancel Settransform ?
c at http://202.57.150.77:8083/index.html and select product when select paticle door mdf hdf furniture and u drag and drop color to target

example : drag yellow color to counter

problem is i want to stable last image when mouse out and will change image only when i mouse up

how to ?


Code:
function checkMe(TargetName) {
if ((this.dragnow=="Yes")) {
if (this[TargetName].mystate == _root.lastkeyaccess) {
if (this[TargetName].hitTest(_root._xmouse, _root._ymouse, true)) {
this.ObjTar = TargetName;
this[TargetName]._visible = true;
this[TargetName].replaceimg._visible = false;
myColor = new color(this[TargetName].maskcolor);
myColor.setTransform(this.mytransform);
this.onMouseUp = function() {
this.AddArray();
};
} else {
this[TargetName]._visible = true;
myArray.sortOn("id");
for (i=0; i<myArray.length; i++) {
this[myarray[i]["id"]]._visible = true;
}
}
}
}
}



Code:
function AddArray() {
if (this.ObjTar !== "") {
if (myArray.length==0) {
myArray.push({id:this.ObjTar});
} else {
myArray.sortOn("id");
for (i=0; i<myArray.length; i++) {
if (myarray[i]["id"]==ObjTar) {
DupArray = "Yes";
}
}
if (DupArray !== "Yes") {
myArray.push({id:this.ObjTar});
}
}
loadMovie("images" + "/" + this.myclip + this.ObjTar + ".jpg", this[ObjTar].replaceimg);
this[ObjTar].replaceimg._visible = true;
// ============return var==============================
this.ObjTar = "";
DupArray = "";
// ===============================================================
}
}

ColorObj Via SetTransform ?
I'm interested in re-assigning color settings to a single MC instance via the setTransform method. I need this to occur when the user releases any one of...say...six buttons (each representing a different color setting).

I know that my new color settings need to be placed in an onClipEvent action on the MC I want to be effected. My question is about how to approach the re-assigning of the color settings.

Is there a way to via on(release) of a button contained on the same timeline to access then change the initial settings...if so, how would I go about. Or, do I have to place this MC instance in the same number of keyframes (each w/ a stop action) as buttons I've placed on my main timeline, and then in each keyframe re-assign the color settings?

Hope this makes sense...

Thanks!

SetTransform Reset?
If you're changing the color of a clip using Color.setTransform and you want to change it back to the original clip color (nothing applied to it), how do you do that?

What Does Offset Actually Do In SetTransform?
I am using setTransform to change a gradient backgrounds colour.

Everything is working fine, I have been give RGB values for the colours from the client.

Say colour a in the gradient is:

R=115 G=61 B=67 (kinda burgandy colour)

and colour b in the gradient is:

R=233 G=78 B=138 (kinda pinky colour)

And no transparency (alpha)

I converted the rgb value to %

colour a = 45,24,66
colour b = 91, 30.6, 54

Can anyone tell me how I create an object to replicate this gradient and what does the Offset values actually mean? Should they all be set to 0?


Code:
myColorTransform = new Object();
myColorTransform.ra = ?;
myColorTransform.rb = ?;
myColorTransform.ga = ?;
myColorTransform.gb = ?;
myColorTransform.ba = ?;
myColorTransform.bb = ?;
myColorTransform.aa = ?;
myColorTransform.ab = ?;


Would really appreciate some help

SetTransform - Reset
hello,

I have been using the setTransform function to change the colour of movie clips. Within these movie clips are buttons. Once the colour has been changed I no longer have the mouseover state on my buttons.

Is there a way to reset the setTransform, or remove the transform, so that the buttons will change colour again on mouseover?

Thanks
Dave

SetTransform To White
I'm trying to get a MC to transform to a white tint using setTransform.
I'd like it to fade to this white from a button. Using this code, it just jumps to white, how can I now get it to fade to that white tint ?

Code:
function whiteout() {
this.onEnterFrame = function() {
this.col = new Color(this);
var factor:Number = .82;
this.rb *= factor;
this.gb *= factor;
this.bb *= factor;
this.normalTransform = {ra:100, rb:255, ba:100, bb:255, ga:100, gb:255, aa:100};
this.col.setTransform(this.normalTransform);
if (this.bb>=255) {
delete this.onEnterFrame;
}
};
}

[F8] Color.setTransform Help...and Hello.
this is my first post here...I am long winded and really want to learn, please read this entire thing, and by all means please do not just refer me to using someone else's extension...I want to do it by hand.

I am a second year college student, but I am much older than most..uh 30 in a few months..I have some experience with Flash, I have made several small projects in class, and I am working on something I want to be really knockout.

I am having a lot of trouble getting the colorTransform to work.
I have read numerous tutorials, and threads here and on other forums. Im not getting something right.

my code follows: currently, each instances code is located on it, with a few things on actions layer, it is a single frame animation, I know I could use a pre-done library, like Rob Penner's, but I weant to use the AS only in flash, only way to really learn something I think. I have tried so many permutations in the code below...calling it ***:Color ***:transform...so many different combinations of things... in hex values in rgb, as a bunch 0-1 decimal, as 0-100 integers...aaack!!! what am I doing wrong.


Code:
/* this code is located on a movie clip symbol in the only frame of my movie, nothing affects it, it affects a textbox remotely. */

onClipEvent (load) {
this.gotoAndStop(1) // so the animation stays on frame 1
//import the needed libs
import flash.geom.ColorTransform;
import flash.geom.Transform;
//create our transform
var octoColor = new Color(octowigg);
varoctoTransform:ColorTransform = new ColorTransform(1,0,0,0,0,0,255,0);
}

on (rollOver) {
this.gotoAndPlay(1); //start playing

setProperty(_root.infobox,_visible,true); //turn on textbox
_root.infobox.infotext.text = "An Octopus can change it's color to blend in with it's surroundings."; //give it the data to display
octoColor.colorTransform(octoTransform); //perform colorTransform, but it doesnt work
}

on (rollOut) {
this.gotoAndStop(1)
setProperty(_root.infobox,_visible,false);

//add the return color transform once working, same as above in reverse

}
now, right now I just want to get my movie clip to get colorized. I am using a bitmap, keyframed animation. Like a Sprite. A prerendered series of frames that I made into a movieClip. So, onRollover, I want my octo to turn red. when I rollOut, I want him to turn back to normal. eventually I want this to be smooth, but I will worry about that later.

The octo wiggles the way it is supposed to, but it does not turn red on rollover. I had gotten it to work by another method..setRGB I think, but it turned the whole clip on color, I want to make it go from blue shades to red shades. I am using Tween class on another object for motion, and it works fine, but it seems that it takes a bit more work to do so with color.

I have set up my code above the best I understand from livedocs, the help file, and tutorials...what am I doing wrong ?

To make it smooth, I will need to use a counter and a variable that I pass to the colortransform as the "ra" property ??

So it seems also that you can use the Tween class on colorTransform, using the transform property of the MovieClip object...
http://livedocs.adobe.com/flash/8/ma...=00002526.html

^^ explains it as an array, which I understand what one IS, but not how to address the colorTransform part of it or use start end parameters to a tween to do this...tough stuff.

I am already several weeks lat on this, I insist on actually learning things in class...so I am doing much things the hard way. so for starters, how do I fix the color transform on the octo ? at least to hard switch "tinting"...then I will concentrate oon using a variable and counter, or passing the transform to the tween class to animate it ??

Please dont just post code and not explain it...walk me through this and why...I have read so much on it...I just need a guru to lay it out in a language other than the "Macrodobe" help writers speak..


thank you most sincerely,
Lord Midnight

ps, um hi Flashkit...>_<

SetTransform Colour
hi, Im using setTransform on an mc, but i don't know what combination of the ba, bb, gb, ga, ra, rb to use to make white. Can anyone help me?


Code:
myColorTransform.ba = 30;
myColorTransform.bb = 50;
myColorTransform.ga = 30;
myColorTransform.gb = 50;
myColorTransform.ra = 30;
myColorTransform.rb = 50;
makes a grey, its as close as i can get!

SetTransform Nightmare
HI
I have been trying to get the set transform object to work.. I have tried everything I can think of in every combination.
I tried different versions of flash and different combinations of both compression and setting the ll,lr. rl. rr options. I tried mono and stereo with just using setPan. if I set to zero values I get no sound at all so the code must be correct. I just get very very bad bleed through no matter what I do.
I prepered several versions of the sound track with nothing on one channel and different outputs from Audition. I still get a very crummy result. I guess it could be my sound card but I am using onboard sound and it is kinda reasonable. I don't think it is that.
I want to run two projectors simulatanously. Well ok four but will settle for two and two pc's. I need to have sets of headphones with just the sound from each movie in seperate cans.
Has anyone any experience that could help me out. I really stuck with this and it is 'sooo bugging me.
Thanks in advance I really would appreciate any tips concerning this.
I have been to Sonify btw. Although it is well written and concise I just cannot get this thing to work to an acceptable level
Cheers
Trug

SetTransform Challenge
Look at the comments in the actions layer of frame 1. Can anyone figure this out?

Help SetTransform Problem.........
Hi!!! to all......

myColor = new Color(myMovie);
myColorTransform = new Object();
myColorTransform = {ra:'50', rb:'244', ga:'40', gb:'112', ba:'12', bb:'90', aa:'40', ab:'70'};
myColor.setTransform(myColorTransform);

This script is working in keyframe but when I try to put it in button its not working. Thanks

SetTransform Challenge
Look at the comments in the actions layer of frame 1. Can anyone figure this out?

Color.setTransform(?)
code...

myColor = new Color(this.geezaBody);
myColorTransform = new Object();
// Set the values for myColorTransform
myColorTransform = { ra: '30', rb: '0', ga: '30', gb: '0', ba: '30', bb: '0', aa: '100', ab: '0'};
myColor.setTransform(myColorTransform);

fine, makes an object pale.  But ive had to get these values with lots of trying, can someone please explain what the terms  'ammount' and 'offset' relate to each other, as defined in the reference (
    â€¢ra is the percentage for the red component (-100 to 100).
    â€¢rb is the offset for the red component (-255 to 255).
etc, etc

)

for example if i have a shape with fill colour 0xff0000 (full red) how do the ra, rb values effect this?  And how would one cancel out a given transform, i.e what is its opposite?

Please Explain Me (setTransform And _quality)
please explain me (setTransform and _quality) using simple example with coding or with uploadable fla file
thanx

Color.setTransform() Method
This is not exactly a question but I thought I'd pass this on to all of you.

I did a little project today that showcases the set.Transform() method of the color object in case any of you haven't seen it in use. This is only one clip with a color Object and set.Transfrom() method and some code to get random offsets and percentages that fade back to the original onLoad colors. It looks pretty neat and the best part is that this is applicable to any bitmap clip at any time. I haven't done much with the Color object except set.RGB and this is my first attempt at anything like that. Truth is, I haven't seen much use of this at all on Flash sites although I can see a bunch of applications for it. Just click anywhere and watch for a while. Then click again.

http://www.geocities.com/vegasdzl/

SetTransform Scripting Problem..
My scripting knowledge is limited, so im still learning, so bare with me if its alittle odd or theres a simple solution to my question...

i just learned how to use the setTransform script and this is wut i want to do....

i have a MC on the main stage and when a user clicks on any random buttom, that MC changes to a color thats designated to that swf and have multiple MC's within the main MC change its alpha once color is changed. here is the script that i have so far and my colors work great:

on (release) {
onEnterFrame = function () {
var myColor = new Color(blueLines);
myColor.setTransform({ra:150, rb:-30, ga:10, ba:20, aa:90, ab:-40});
blueLines.lightblueLine._alpha = 50;
blueLines.medblueLine._alpha = 80;
blueLines.darkblueLine._alpha = 100;
};
}

now i was able to have the color change with no fade and then i changed the last parts to _alpha -=5; but it just fades completely to zero.

is there a way to fade into the color and alpha? or am i going about this the wrong way? i have looked up color fades etc but when i try to test that code, i end up getting an error message stating it needs to be followed by an operand.

is there anyone that can help me out? greatly appreciated

Tracy

Problem About Color.setTransform
Hi all,
I got some problem when I using setTransform();

I got a clip like this
http://gravisphere.com/temp/p1.swf

but if I add this code

Code:
var my_color:Color = new Color(myMC);
var myColorTransform:Object = {ra:100, rb:0, ga:100, gb:122 ,ba:100, bb:0, aa:100, ab:0};
my_color.setTransform(myColorTransform);
it will become this
http://gravisphere.com/temp/p2.swf

the MC keeping the look in 1st frame...
hope someone help

Sound----getTransform And SetTransform
Could someone send me a example on hoe to use the getTransform() and then send it to output window and also the setTransform() and what the parameters mean.

Default SetTransform Properties
hi every1
I want the user to be able to change the colour of an mc by displaying a box with GREEN RED BLUE and have little plus n minus signs to increase the tint etc.

Now I have the following code:

Code:

myColour = new Color(_root.mc);
myColorTransform = new Object();
myColorTransform.ra += 10;
myColorTransform.rb += 10;
when a client presses the plus for red, however this doesnt work can anyone help me I realy dont know what im doing

Problem With Color.setTransform
Hello all,

After a colortransform with the regular Color.setTransform class, a problem occurs.

I have 4 identical movieclips
In those movieclips is a small timeline to do a small animation.
on the timeline are 3 movieclips which have to bounce a little (just a view pixels in uppwards direction)
This happens in 5 separate keyframes
until the color.setTransform is done this works perfectly,
After the colortransform the 3 movieclips seems to be on a fixed position and do not bounce anymore. The frames are being played but the three movieclips don't move anymore.

Does this sound familiar to anyone?

Thanks in advance

Jerry

It looks like the _x and _y positions is set to a fixed position and







Attach Code

Color_on = new Object({ra:'100', rb:'0', ga:'100', gb:'0', ba:'100', bb:'0', aa:'100', ab:'0'});
function over() {
ColorOn = new Color(this), kleurAan.setTransform(Color_on);
};

Color_off = new Object({ra:'40', rb:'0', ga:'40', gb:'0', ba:'40', bb:'0', aa:'100', ab:'0'});
function out() {
ColorOff = new Color(this), kleurAan.setTransform(Color_off);
};

[as 2][help]Problem About Color.setTransform
Problem about Color.setTransform
Hi all,
I got some problem when I using setTransform();

I got a clip like this
http://gravisphere.com/temp/p1.swf

but if I add this code


code:--------------------------------------------------------------------------------
var my_color:Color = new Color(myMC);
var myColorTransform:Object = {ra:100, rb:0, ga:100, gb:122 ,ba:100, bb:0, aa:100, ab:0};
my_color.setTransform(myColorTransform);
--------------------------------------------------------------------------------

it will become this
http://gravisphere.com/temp/p2.swf

the MC keeping the look in 1st frame...
hope someone help

Audio In Flash, Volume, Pan & SetTransform
HEY,
i have encountered a problem with using sounds in flash, what i need to do is have one sound play through the right speaker and a different sound through the left, then independant volume controls for each sound and a cross fader to switch between left and right speakers.

The desired effect is to pretty much have a mixer. a loop through the left speaker and a sample through the right so you can adjust volume and panning.

I have tried using setTransform to send each sound to its own speaker, setVolume to adjust volume on each sound and setPan to go across the speakers, but it just wont work, PLEASE HELP!!!

Tweening Color Animations With SetTransform
Hello all,

I just wanted to briefly thank all of the experinced AS coders who are willing to help out the newcomers to actionscript; without all of their posts I'd be utterly lost, instead of merely somewhat lost as I am now.

So here's my question: I'm trying to get a piece of code that increments the values for setTransform to make a more gradual transition to a color than the one frame jump that it usually does.

I've got a random image on my stage that I have named "pict" and converted into a movie clip. Attached to the movie clip is the following code:

code:
onClipEvent(load) {
var oNewColor:Object = new Object();
oNewColor.rb = cVarR;
oNewColor.gb = cVarG;
oNewColor.bb = cVarB;

cVarR = 0;
cVarG = 0;
cVarB = 0;
}

onClipEvent(enterFrame) {
newcVarR = -100;
newcVarG = 80;
newcVarB = 120;
if (newcVarR < cVarR) {
cVarR = cVarR - 20;

} else if (newcVarR > cVarR) {
cVarR = cVarR + 20;

}

if (newcVarG < cVarG) {
cVarG = cVarG - 20;

} else if (newcVarG > cVarG) {
cVarG = cVarG + 20;

}

if (newcVarB < cVarB) {
cVarB = cVarB - 20;

} else if (newcVarB > cVarB) {
cVarB = cVarB + 20;

}var cPict:Color = new Color(pict);
cPict.setTransform(oNewColor);
trace(cVarR+" , "+cVarG+" , "+cVarB);
}


The trace function returns that the values are incrementing as I want, but the image itself never changes. I suspect this is more of me not getting the AS logic yet, since that's what's been bedeviling me.

Currently, and for the forseeable future, I am using MX 04. Someday, when I win the lotto, I'll buy 8. :P

As always, any information is much appreciated.

Pacem!
--T

Get Color Code For SetTransform Property
I was reading the help on the setTransform property and it said i needed an object like the example below. That's fine but I don't know how to convert the rgb or hexidecimal code into the format it is below... any help?

var myColorTransform:Object = { ra: 50, rb: 244, ga: 40, gb: 112, ba: 12, bb: 90, aa: 40, ab: 70};

SetTransform Not Working On Movie Clip
html: http://www.roscoecreations.com/main_flash.html
fla: http://www.roscoecreations.com/main_flash.fla

When you rolllover the guy on the left I want the grey to turn to a darker grey but nothing happens. Something must be wrong in my code.

SetPan() And SetTransform() In MediaController Component
Hi, this is my first time here and I need help on this issue:
I need to set setPan() and/or setTransform() for a sound that is being played trough the media Controller component and Media Display component.
It is an mp3 file loaded dynamically using an xml list.
The sound plays fine, I'm able to control things such as volume but when I try to use the setPan() command it just do not work.
I think the path for the instance is ok once I can use the setVolume() command.
The flash document is made in FalshMX2004 Pro.
The path to the object I need to control is
level0.jukebox_acc.nowplaying_mc.mp3_mediadisp._pl ayerImpl
If I use this command
level0.jukebox_acc.nowplaying_mc.mp3_mediadisp._pl ayerImpl.setVolume(10) it woks fine but not if I use
level0.jukebox_acc.nowplaying_mc.mp3_mediadisp._pl ayerImpl.setPan(-100)

Can anyone explain me why setPan() and setTransform() is not working?

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