|
-
Follow up...
Ok, I believe I have the bases covered, but there's still something that's preventing the movie from meshing properly.
Here is my floor constructor. When the XML is done loading, the constructor is called, passing in the XML object. It loops through the XML data (provided after the floor script) and references instances on the stage.
Code:
class Floor{
var count:Number;
var btn:Array;
public function Floor(xml:XML){
for(var i = 0; i < xml.firstChild.childNodes.length; i++)
{
var officeNum = xml.firstChild.childNodes[i].firstChild.firstChild;
var statusColor = xml.firstChild.childNodes[i].childNodes[2].firstChild;
trace ("office"+officeNum);
trace (statusColor);
btn[i] = new Office(eval("office"+officeNum),officeNum,statusColor);
}
count = i;
}
XML:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<flr>
<office>
<number>305</number>
<use>Rae</use>
<sts>0x66CC00</sts>
<msg>Food found. Back to work.</msg>
</office>
<office>
<number>303</number>
<use>Jared</use>
<sts>0xFFCC00</sts>
<msg>Luminisssssssss</msg>
</office>
<office>
<number>301</number>
<use>Peter</use>
<sts>0x999999</sts>
<msg>Working from home.</msg>
</office>
</flr>
The first trace line traces out office305, office303, and office301 in the output box, so I can't tell if the eval is doing what I need it to or not. There are three movie clip instances on the stage called office305, office303, and office301, so I was hoping that using eval would actually pass those instances to the office constructor. I have no idea if this is working or not...
Here is my office constructor.
Code:
class Office{
private var id:String;
public function Office(mc:MovieClip,num:String,code:String)
{
mc.onRollOver = mcRollOver(mc);
mc.onRelease = mcRollOver(mc);
mc.onRollOut = mcRollOut(mc);
//mc.setStatus(sCode) = setStatus(mc,sCode);
var myColor = new Color(mc.bg);
myColor.setRGB(code);
id = num;
}
public function mcRollOver(mc){
//tt.revealToolTip(id);
mc.gotoAndPlay("over");
}
public function mcRollOut(mc){
//tt.hideToolTip();
mc.gotoAndPlay("up");
}
Here's what my individual MCs look like, plain and simple.

Each frame has a stop(); and there are no other actions associated with it.
In the bg layer, there is a MovieClip called bg with just a shape within the mc. My goal was to be able to use the setRGB to change the color of this bg clip when the status is read at the very beginning, and then have the mouseOver and Out actions advance the frames so that a highlight appears on the "over" position.
When I play the movie like this, I get a mouseOver cursor on the three mcs, but no color changes happen or highlights. That aside, I still have to figure out how to change the tooltip data from the button rollOver and rollOut functions, seeing as the tooltip is just sitting on the stage. I can't figure out how to get my classes to interact with external objects and functions in the stage... Is there an easy way to do that? I'm having trouble passing the objects through functions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|