Im designing a scaling button uses packages and classes. When I run the script it throws a syntax error on line 21 expecting a rightbrace before public in this package:
package
{
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import DisablingButton;
import ScaleButton;
public class ButtonSet extends MovieClip
{
public var buttons:Array;
public function ButtonSet();
{
}
public function addButtons(buttonSet:Array):void
{
buttons = buttonSet;
for(var i:int = 0; i < buttons.length; i++)
{
addChild(buttons*);
}
}
}
}
As you can see, the problem doesn’t originate here. So, here is the other packages that call this:
package
{
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import ButtonSet;
public class DisablingButton extends MovieClip
{
var labels:Array;
var thisParent:*;
var thisIndex:int;
public function DisablingButton()
{
labels = this.currentLabels;
this.addEventListener(MouseEvent.CLICK, disableButton);
this.addEventListener(MouseEvent.ROLL_OVER, over1);
this.addEventListener(MouseEvent.ROLL_OUT, out1);
this.addEventListener(Event.ADDED, setParent);
}
function disableButton(event:MouseEvent):void
{
for (var i:int = 0; i < labels.length; i++)
{
if(labels*.name =="disable")
{
this.gotoAndPlay("disable");
}
}
this.removeEventListener(MouseEvent.CLICK, disableButton);
this.removeEventListener(MouseEvent.ROLL_OVER over1);
this.removeEventListener(MouseEvent.ROLL_OUT, out1);
enableOthers();
}
function enableButton():void
{
this.addEventListener(MouseEvent.CLICK, disableButton);
this.addEventListener(MouseEvent.ROLL_OVER, over1);
this.addEventListener(MouseEvent.ROLL_OUT, out1);
this.gotoAndStop(1);
}
function over1(event:MouseEvent):void
{
for(var j:int = 0; j < labels.length; j++)
{
if (labels[j].name == "over")
{
this.gotoAndPlay("over");
}
}
}
function out1(event:MouseEvent):void
{
for(var k:int = 0; k < labels.length; k++)
{
if (labels[k].name == "out")
{
this.gotoAndPlay("out");
}
}
}
function setParent(event:Event):void
{
if(this.parent is ButtonSet)
{
thisParent = ButtonSet(this.parent);
for (var w:int=0; w < thisParent.buttons.length; w++)
{
if(this == thisParent.buttons[w])
{
thisIndex=w;
}
}
}
}
function enableOthers():void
{
for(var z:int=0; z < thisParent.buttons.length; z++)
{
if (z !=thisIndex)
{
thisParent.buttons[z].enableButton();
}
}
}
}
}
AND…
package
{
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import ButtonSet;
public class ScaleButton extends MovieClip
{
var labels:Array;
var thisParent:*;
var overXTween:Tween;
var overYTween:Tween;
var outXTween:Tween;
var outYTween:Tween;
var thisIndex:int;
public function ScaleButton()
{
labels = this.currentLabels;
this.addEventListener(MouseEvent.CLICK, disableButton);
this.addEventListener(MouseEvent.ROLL_OVER, over1);
this.addEventListener(MouseEvent.ROLL_OUT, out1);
this,addEventListener(Event.ADDED, setParent);
outXTween = new Tween(this, "scaleX", None.easeNone, 1.25, 1, .25, true);
outYTween = new Tween(this, "scaleY", None.easeNone, 1.25, 1, .25, true);
overXTween = new Tween(this, "scaleX", None.easeNone, 1, 1.25, .25, true);
overYTween = new Tween(this, "scaleY", None.easeNone, 1, 1.25, .25, true);
outXTween.stop();
outYTween.stop();
overXTween.stop();
overYTween.stop();
}
function disableButton(event:MotionEvent):void
{
this.removeEventListener(MouseEvent.CLICK, disableButton);
this.removeEventListener(MouseEvent.ROLL_OVER, over1);
this.removeEventListener(MouseEvent.ROLL_OUT, out1);
enableOthers();
}
function enableButton():void
{
this.addEventListener(MouseEvent.CLICK, disableButton);
this.addEventListener(MouseEvent.ROLL_OVER, over1);
this.addEventListener(MouseEvent.ROLL_OUT, out1);
this.gotoAndStop(1);
if(this.scaleX == overXTween.finish)
{
outXTween.start();
outYTween.start();
}
}
function over1(event:MouseEvent):void
{
overXTween.start();
overYTween.start();
}
function out1(event:MouseEvent):void
{
outXTween.start();
outYTween.start();
}
function setParent(event:Event):void
{
if(this.parent is ButtonSet)
{
thisParent = ButtonSet(this.parent);
for (var w:int=0; w < thisParent.buttons.length; w++)
{
if(this == thisParent.buttons[w])
{
thisIndex=w;
}
}
}
}
function enableOthers():void
{
for(var z:int=0; z < thisParent.buttons.length; z++)
{
if(z !=thisIndex)
{
thisParent.buttons[z].enableButton();
}
}
}
}
}
Anybody see any problems here???