我需要一些帮助。
我有一个类文件,我已经导入它,如下图所示:
这个文件的代码是:
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];
}
}
}
现在我想从时间轴导入这个文件。可能吗; 我从文档属性中删除类名并从时间线(frame1)导入它,例如:import Main
什么都没发生。
谢谢!