What up people?!
I have this "small" problem.
I'm building a small website. It's external class based and the ideia is to load the menus and content externally, by XML.
I'm using as base code an example from "Learning Actionscript 3.0 Book", from Rich Shupe and Zevan Rosser.
My class structure, I believe, is working well, but somehow one of the classes is not working properly.
The problem happens in line 21 and line 27. The error is the following:
NavigationBar: line 21 (and 27);
1136: Incorrect number of arguments. Expected 0.
source: var menuBtn:MenuButtonMain = new MenuButtonMain( _navData.button[i].@label);
This is my AS3 class. It intereacts with more classes, so if you need the other classes to check, feel free to ask.
ActionScript Code:
package app.gui{
import flash.display.Sprite;
import flash.filters.DropShadowFilter;
public class NavigationBar extends Sprite {
private var _app:Sprite;
private var _buttonSpacing:int;
private var _hline:HLineThick;
private var _navData:XMLList;
public function NavigationBar(app:Sprite, navData:XMLList) {
_app = app;
_navData = navData;
_buttonSpacing = _navData.@spacing;
build();
}
private function build():void {
for (var i:int; i < _navData.button.length(); i++) {
var menuBtn:MenuButtonMain = new MenuButtonMain( _navData.button[i].@label);
menuBtn.x = 20 + (menuBtn.width + _buttonSpacing) *i;
menuBtn.y = 75;
var subMenuButtonNum:uint = _navData.button[i].project.length();
for (var j:uint = 0; j < subMenuButtonNum; j++) {
var subMenuButton:MenuButtonSub= new MenuButtonSub( _app, _navData.button[i].project[j]);
subMenuButton.y = ((subMenuButton.height -2) * j);
menuBtn.subMenu.addChild(subMenuButton);
}
addChild(menuBtn);
}
_hline = new HLineThick();
_hline.y=100;
_hline.mouseEnabled=false;
addChild(_hline);
var ds:DropShadowFilter = new DropShadowFilter();
ds.angle=45;
ds.distance=5;
ds.alpha=0.5;
filters=[ds];
}
}
}
Thanks for the help ;-)