please help me out converting the code below into as3. I have no ideea what is "SHEMA" , "BASE", "GLANCE" etc for AS3. THanks a lot. This code is being written inside a movie clip.
function CopyFromShema(sframe)
{
SHEMA.gotoAndStop(sframe);
GLANCE.filters = SHEMA.GLANCE.filters;
BASE.filters = SHEMA.BASE.filters;
CAPTION.filters = SHEMA.CAPTION.filters;
}
SHEMA._visible = false;
SHEMA.gotoAndStop(1);
BASE.scale9Grid = new flash.geom.Rectangle(10, 10, 100, 5);
GLANCE.scale9Grid = new flash.geom.Rectangle(10, 6, 100, 2);
onRollOver = function ()
{
CopyFromShema(3);
}
;
onRollOut = function ()
{
CopyFromShema(2);
}
;
onPress = function ()
{
CopyFromShema(4);
}
;
onRelease = function ()
{
CopyFromShema(3);
}
;
onDragOver = function ()
{
onPress();
}
;
onDragOut = function ()
{
onRollOut();
}
;
as pointed in line "3" of provided code in question, SHEMA.gotoAndStop(sframe);
they are all MovieClips
and not As2 Classes/Keywords.
everything is ok in AS3 just replace (do it for all event fucntions)
onRollOver = function ()
{
CopyFromShema(3);
};
with As3 Event handlers
stage.addEventListener(MouseEvent.ROLL_OVER, function(e:MouseEvent):void {
CopyFromShema(3);
});
about other MouseEvents :
so what to do with non available events in as3? they are available but you have to handling them with bunch of available events, here is an example of it.
most times, there is no real need for porting AS2 to AS3, but you can simply compile AS2 projects as swf, then embedding them in to the AS3 projects, and let them communicate with each other trough a LocalConnection
as mentioned here