|
-
Help needed about functions
code: var select:Object = sym01_id;
this code doesn't give error but this code:
code: function prepareDrag(event:MouseEvent):void {
var select:Object = sym01_id;
}
gives following error:
1180: Call to a possibly undefined method select.
var newSymbol:* = new select();
Can anyone help me?
-
Senior Member
What is sym01_id, a function?
- The right of the People to create Flash movies shall not be infringed. -
-
sym01_id is a library item. The code var newSymbol:* = new select(); is inside another function whose name is firstDrag
-
Senior Member
I don't quite understand what you are doing. But as the error states select() is something undefined. The syntax var newSymbol:* = new select(); is used to call a new object like
var a:MovieClip = new MovieClip(); Also why do you use the * as datatype?
- The right of the People to create Flash movies shall not be infringed. -
-
I'm trying to give names to library symbols.
I don't quite understand what you are doing. But as the error states select() is something undefined. The syntax var newSymbol:* = new select(); is used to call a new object like
var a:MovieClip = new MovieClip(); Also why do you use the * as datatype?
Because I don't know what to use. I've tried some types but they didn't work. My other function is:
code: function firstDrag(event:MouseEvent):void {
if (isMenuOpen==true) {
var allSymbols:Object = { };
var str:String = "sym" + num;
var newSymbol:* = new select();
allSymbols[str] = newSymbol;
addChild(newSymbol);
newSymbol.startDrag();
newSymbol.x = mouseX;
newSymbol.y = mouseY;
newSymbol.buttonMode = true;
newSymbol.useHandCursor = true;
newSymbol.addEventListener(MouseEvent.MOUSE_DOWN, dragSelection);
newSymbol.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
newSymbol.hitArea = newSymbol.sym01_btn;
removeChild(menuBack);
num = num + 1;
isMenuOpen = false;
}
}
Last edited by onurcan1977; 06-01-2009 at 04:45 PM.
-
The problem is solved
code: var select:Object;
function prepareDrag1(event:MouseEvent):void {
select = sym01_id;
firstDrag();
}
Thanks for helps.
Tags for this Thread
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
|