Yeah, that was a typo - it's actually seen as a flash object.

Here's the thing; I could probably make this a hell of a lot easier on me.
First let me say what I want to do, then explain how I was trying it, then
I'll sum up with 2 possible fixes.


- what I want to do.
I've 3 movieclips that are being used basically as highlight areas, or more
along the lines of interface elements that will be controlled in director
via a timeout object for blinking, etc etc. The flipping of colors and color
control needs to happen in director - I'm sure I could even just call a
function in the flash file to do the coloring, etc, but I thought it would
be easier to have the control of the interface elements happening in
director rather than the timeoutobject telling flash to control itself,
basically.

So, since there's no movieclip property for _color or _tint, only _alpha, I
then tried to create 3 global variables as pointers to each mc's color.

Then in director I was attempting to control those colors - realized I had
to create color transform objects, so was attempting to create the flash
object transforms in lingo.

In AS the color transform would be
TransColor = new Object();
Transcolor = {ra: '50', rb: '50', ga: '40', gb: '40', ba: '12', bb: '90',
aa: '40', ab: '70'};

But I tried in lingo
Transcolor = sprite(x).newObject("object")
Then I had to go through each of the above values using
Transcolor.setProp(#ra: 50), etc etc.

So finally as a test: with the bkgcolor =
sprite(x).getVariable("movieclipstrip", false) <-- ie movieclip strip is a
_global.movieclipstrip = new color (mc_strip);  --- that is bkgcolor is a
reference to a global variable in a flash sprite that is a pointer to the
movieclip's color object...phew! Basically this works in flash if I do
tests.

So finally I now have lingo pointers to 2 different flash objects - one a
global variable that is a pointer to a movieclips color object, the other is
a lingo-created flash object that should be a color transform...

So I now try bkgcolor.settransform(transcolor) and --

Director fatal error.  Hmm...

So perhaps it was the created transform that isn't flash kosher.
So I now try a new global variable that is doing the color transform within
actionscript...

So in the Actionscript:

_global.vsBkg = new Color(mc_strip);
_global.hilite = new Object();
Hilite = {ra: '50', rb: '50', ga: '40', gb: '40', ba: '12', bb: '90', aa:
'40', ab: '70'};



Well now in director I do:

Bkgcolor = sprite(x).getVariable("vsBkg", false)
Hilite = sprite(x).getVariable("hilite", false)


And now if I....

Bkgcolor.setTransform(hilite)

BOOM! Works!

Ok so there's something in the way that lingo can create objects; in some
cases (kind of like your article states) it's better to pass the creation of
such objects to flash.

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to