I solved it myself:
flash code:
colorLot = function (name, value)
{
clr = new Color(_root[name]);
if (value == 1)
{
clr.setRGB(0xFFFFFF);
}
else if (value == 2)
{
clr.setRGB (0xFF6600);
}
else if (value == 3)
{
clr.setRGB (0xFFFF00);
}
else if (value == 4)
{
clr.setRGB (0xFF0000);
}
};
checkHit = function (name)
{
return _root[name].hitTest(_root._xmouse, _root._ymouse, true);
};
director code:
on beginSprite me
pFlash = sprite(me.spriteNum)
pFlash.eventPassMode = #passAlways
pFlash.actionsEnabled = true
pActiveClip = void
pEnabled = false
end
on activeLot me
return not(voidP(pActiveClip))
end
on startEverything me
pEnabled = true
myObj = pFlash.getvariable("_level0",False)
lotItems = sitesList[gSitePlan]
howMany = lotItems.count
repeat with i = 1 to howmany
aName = lotItems.getPropAt(i)
val = value(lotItems[i])
myObj.colorLot(aName, val)
end repeat
end
on updateLot me, val
if not voidP(pActiveClip) then
myObj.colorLot(pActiveClip, val)
end if
end
on mouseDown me
sendAllSprites(#popDown)
if pEnabled then
aloc = pFlash.stageToFlash(the mouseLoc)
aList = pFlash.objectList
pActiveClip = void
repeat with mc in aList
targetClip = string(mc)
if myObj.checkHit(targetClip) = 1 and targetClip <> "_level0" then
pActiveClip = targetClip
exit repeat
end if
end repeat
if voidP(pActiveClip) then
sendAllSprites(#clearData)
else
sendAllSprites(#showData, pActiveClip)
end if
put pActiveClip
end if
end
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ken Hubbell
Sent: Thursday, August 19, 2004 10:37 AM
To: [EMAIL PROTECTED]
Subject: <lingo-l> FLash MovieClip referencing
All,
I am trying to change the color of a movieClip that is in a .swf in
sprite(1) of my movie. The movieClip is named "hwlot01" and is in a layer
called "lots" at the root level of my flash movie. Here is the code I am
using to unsuccessfully change the color:
clr = sprite(1).newObject("Color", "_level0.lots[" & QUOTE & "hwlot01" &
QUOTE & "]")
clr.setRGB("0xFFFFFF")
I cannot embed a function in the .swf to do this for other reasons.
Please advise as to why this is not working.
Thanks,
Ken
[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!]
[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!]