I need some help please.
I have a class file and i have importing it as you can see from the image below:
And the code of this file is:
package
{
import flash.display.Sprite;
import fl.motion.AdjustColor;
import flash.filters.ColorMatrixFilter;
import fl.events.SliderEvent;
public class Main extends Sprite
{
private var color:AdjustColor = new AdjustColor();
private var filter:ColorMatrixFilter;
public function Main():void
{
/* Required to create initial Matrix */
color.brightness = 0;
color.contrast = 0;
color.hue = 0;
color.saturation = 0;
/* Add Listeners function */
addListeners();
}
private final function addListeners():void
{
colorPanel.brightSL.addEventListener(SliderEvent.CHANGE, adjustBrightness);
colorPanel.contSL.addEventListener(SliderEvent.CHANGE, adjustContrast);
colorPanel.hueSL.addEventListener(SliderEvent.CHANGE, adjustHue);
colorPanel.satSL.addEventListener(SliderEvent.CHANGE, adjustSaturation);
}
private final function adjustBrightness(e:SliderEvent):void
{
color.brightness = e.target.value;
update();
}
private final function adjustContrast(e:SliderEvent):void
{
color.contrast = e.target.value;
update();
}
private final function adjustHue(e:SliderEvent):void
{
color.hue = e.target.value;
update();
}
private final function adjustSaturation(e:SliderEvent):void
{
color.saturation = e.target.value;
update();
}
private final function update():void
{
filter = new ColorMatrixFilter(color.CalculateFinalFlatArray());
image.filters = [filter];
}
}
}
Now i want to import this file from timeline. Is it possible; I i remove the class name from the document properties and import it from timeline (frame1) like: import Main
Nothing happens.
Thanks!
var main:Main = new Main();
– Ronnie