I am in a little trouble, we contracted a programmer to help us with a project and he hasn’t come through for us and I have been asked to try and get something ready asap. First off I am not programmer, I no little actionscript but thats all. He built a menu for us located at this link: http://visualizer.dev.webriverintera…isualizer.html
At the top we have Select a Space and Select Flooring Product, If you click on Select a Space you can click on one of six menu options. Within each one of these menus options are 4 images that you can click on. I am using Flash CS3, and I have added a zip file that contains the menu package. I have tried in my own way to run some trace statements to figure out what is doing what but I’m like fish out of water here and could use some help. I managed to figure out what the image name is when I click on it but I can’t get my image to load. The progress bar appears but no image.
I am not sure I am even doing this correctly, so any help would greatly appreciated.
//m down function works for both Select a Space and Select a Floor menus
private function m_down(e:MouseEvent) {
//hide the viewer_mc
MovieClip(root).introViewer_mc.visible = false;
//
var nArray : Array = new Array();
nArray = e.currentTarget.mArr;
//load room image into viewport
//create a container to hold the large room images
var roomContainer:MovieClip = new MovieClip();
var rmloader:Loader = new Loader();
var loadBar:MovieClip = new MovieClip();
var percent:TextField = new TextField();
//trace(e.currentTarget.image);
if (e.currentTarget.image == "images/education_1_sm.jpg") {
trace("the same");
e.currentTarget.image = "education_K12_1-floor-cutout.png";
}
//trace(e.currentTarget.image);
//set room location
roomContainer.x = 0;
roomContainer.y = 0;
roomContainer.width = 662;
roomContainer.height = 410;
addChild(roomContainer);
//add the default large room
// add room image to the viewport
rmloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
rmloader.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
rmloader.load(new URLRequest("resources/rooms/"+e.currentTarget.image));
trace("resources/rooms/"+e.currentTarget.image);
rmloader.x = 0;
rmloader.y = 0;
rmloader.width = 300;
rmloader.height = 300;
/////////
//create text field
var percformat:TextFormat = new TextFormat();
percformat.font = "Arial";
percformat.size = 12;
percent.defaultTextFormat = percformat;
percent.autoSize = TextFieldAutoSize.LEFT;
percent.x=330;
percent.y=330;
addChild(percent);
function loop(event:ProgressEvent):void {
//create progress bar
var barColor:Number = Number(0xCCCCCC);
loadBar.graphics.lineStyle(1, 0xCCCCCC);
loadBar.graphics.beginFill(barColor);
loadBar.graphics.drawRect(0,0,100,10);
loadBar.graphics.endFill();
loadBar.width=1;
addChild(loadBar);
loadBar.x=300;
loadBar.y=300;
var perc:Number = event.bytesLoaded / event.bytesTotal;
loadBar.scaleX=perc;
percent.text = Math.ceil(perc*100).toString() + "%";
}
function done(event:Event):void {
//loadBar.visible = false;
//percent.visible = false;
roomContainer.addChild(rmloader);
}
/////
for (var i : uint = 0; i < nArray.length; i++) {
if (e.currentTarget.idx != i) {
if ( nArray*.name == "space") {
nArray*.blue.visible = false ;
} else {
nArray*.txtHolder.blue.visible = false;
}
if ( !nArray*.hasEventListener(MouseEvent.MOUSE_OUT)) {
if ( nArray*.name == "space") {
nArray*.addEventListener(MouseEvent.MOUSE_OUT , m_out);
} else {
nArray*.addEventListener(MouseEvent.MOUSE_OUT , w_out);
}
}
} else {
if (nArray*.hasEventListener(MouseEvent.MOUSE_OUT)) {
if ( nArray*.name == "space") {
nArray*.removeEventListener(MouseEvent.MOUSE_OUT , m_out);
nArray*.blue.visible = true;
} else {
nArray*.removeEventListener(MouseEvent.MOUSE_OUT , w_out);
nArray*.txtHolder.blue.visible = true;
}
}
}
}
}