Thanks Rich,

Not sure what caused the bounce but I find that is I just reply to a post, it goes to the private email address rather than the list; I need to remeber to 'reply to all' all the times, a real pain .

Quite a few little tips in your code, and i am learning, much appreciated; it all goes to better practices.

Unfortunately your code (unchanged) does not work for me, while the following does :)

//____________  Init properties and variables _____________________________
//
var myTxt:Array = new Array("branding", "news", "about us", "print", "marks", "contact");
var subMenuArray:Array = new Array();
var myBtnArray:Array = new Array();
var myX = 430;
var ySpacing:Number = 190;

var btn:Button;
//
//
//_________________create a movieClip to hold the vertical label_________________
//
_root.lable_mc.createTextField("myName", this.getNextHighestDepth(), 484, 200, 140, 408);
myNformat = new TextFormat();
myNformat.font = "Verdana";
myNformat.size = 70;
myNformat.bold = true;
myNformat.color = 0xEEEEEE;
myNformat.selectable = false;
//0xF6F6F6;
myNformat.align = "center";
_root.lable_mc.myName.text = "contact";
_root.lable_mc.myName.setTextFormat(myNformat);
//
//
//____________________create the textFields for the subMenuItems___________________
//
for (i=0; i<myTxt.length; i++) {
_root.createTextField("mytext"+i, this.getNextHighestDepth(), myX, 0, 100, 30);
   myId = _root["mytext"+[i]];
   myId._y = ySpacing;
   ySpacing += 20;
// //trace(myTxt[i]);
   myId.text = myTxt[i];
   //
   //____________Format the text of the subMenuItems_____________________
   //
   myId.border = false;
   myformat = new TextFormat();
   myformat.font = "Verdana";
   myformat.size = 13;
   myformat.bold = true;
   myformat.color = 0x555555;
   myformat.align = "right";
   //
   myId.selectable = false;
   myId.setTextFormat(myformat);
   //
//__create an Array with the submenuItems to be used in the buttons control function______
   //
   subMenuArray.push(myId.text);
   //
   //____________attach a button (on top of) to each textFields__________
//_____use myTxt[i] to create the buttons names to manage the navigation later_____
   //
btn = this.attachMovie("butt_btn", myTxt[i], this.getNextHighestDepth());
   btn._alpha = 0;
   btn._x = myX;
   btn._y = myId._y;
   //
   btn.onRelease = function() {
       trace(this._name);
   };
//_________create an array to use later to control the buttons_____________
   //
   myBtnArray.push(btn);
//trace("The y for "+myBtnArray[i]+" is: "+btn._y+" and its x is: "+btn._x); // }



Lists wrote:

John,

(FYI, there's something wrong with your reply to that caused this to bounce
last night with a 501 Bad address syntax error. It looks like your own
address and FlashCoders have been combined into one. I'm not sure if that
error is from you, the list, or one of the gateways along the way, but you
might want to look into it, as I have only had this problem with replying to
your post. Here's the body of the email I sent last night.)

I've made a lot of assumptions about what you're trying to do, but it looks
like you have a lot of odd syntax in your script. Avoid using _root whenever
possible, use brackets only for array indices, etc. You can also assign the
create and attach returns to a variable immediately, instead of after the
fact.

As for how you can reference the code for the relevant functions, you can
reference them either by their newly created instance name, by their
inclusion in your arrays, or you can add a function during creation.

This script addresses most of these issues and works:

//
//create missing mc lable_mc. rotated 90-degrees? ("vertical label")
//
this.createEmptyMovieClip("lable_mc",this.getNextHighestDepth());
//
//Init variables
//
var myTxt:Array = new Array("branding", "news", "about us", "print",
"marks", "contact");
var subMenuArray:Array = new Array();
var myBtnArray:Array = new Array();
var myX:Number = 430;
var ySpacing:Number = 190;
var myId:TextField;
var myformat:TextFormat;
var btn:Button;
//
//create a movieClip to hold the vertical label
//
lable_mc.createTextField("myName", this.getNextHighestDepth(), 484, 200,
140, 408);
var myNformat:TextFormat = new TextFormat();
myNformat.font = "Verdana";
myNformat.size = 70;
myNformat.bold = true;
myNformat.color = 0xEEEEEE;
myNformat.align = "center";
lable_mc.myName.text = "contact";
lable_mc.myName.setTextFormat(myNformat);
//
//create the textFields for the subMenuItems
//
for (var i:Number = 0; i < myTxt.length; i++) {
   myId = this.createTextField("mytext" + i, this.getNextHighestDepth(),
myX, 0, 100, 20);
   myId._y = ySpacing;
   ySpacing += 20;
   myId.text = myTxt[i];
   //Format the text of the subMenuItems
   myId.border = false;
   myformat = new TextFormat();
   myformat.font = "Verdana";
   myformat.size = 13;
   myformat.bold = true;
   myformat.color = 0x555555;
   myformat.align = "right";
   myId.selectable = false;
   myId.setTextFormat(myformat);
   //
   //array with submenuItems for button control
   //
   subMenuArray.push(myId.text);
   //
   //attach a button (on top of) to each textFields
   //
   btn = this.attachMovie("butt_btn", "butt" + i,
this.getNextHighestDepth());
   btn._x = myX;
   btn._y = myId._y;
   btn.onRelease = function () {
       trace(this._name);
   }
   //
   //create an array to use later to control the buttons
   //
   myBtnArray.push(btn);
}

Rich Shupe


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to