hallo habe im web folgende as gefunden und möchte aber das die bilder transparent sind , zb wenn ein png mit transparent geladen wid dies auch erkannt wird.
hier die as:
package
{
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
public class Item extends Sprite
{
private var imageURL:String;
private var reflectionLoader:Loader;
private var reflection:Sprite;
public var image:Sprite;
private var imageLoader:Loader;
public var content:String;
private var link:String;
private static var GLOW:GlowFilter = new GlowFilter(9478873, 1, 16, 16, 3, 2, false, false);
private static const BORDER_COLOR:uint = 9478873;
private static const SITB_STICKER_PATTERN:RegExp = /_PI[^_]+/;
private static var DROPSHADOWropShadowFilter = new DropShadowFilter(0, 0, 9478873);
private static const DISCOUNT_STICKER_PATTERN:RegExp = /_PE[^_]+/;
private static const IMAGE_SOURCE_PATTERN:RegExp = /src="([^"]*)"/;
public function Item(param1:String, param2:String, param3:String)
{
this.imageURL = fixImageURL(param1);
this.content = param2;
this.link = param3;
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
imageLoader.load(new URLRequest(imageURL));
reflectionLoader = new Loader();
reflectionLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onReflectionLoaded);
reflectionLoader.load(new URLRequest(imageURL));
return;
}// end function
private function onReflectionLoaded(param1:Event) : void
{
var _loc_2:Sprite;
var _loc_3:Shape;
var _loc_4:Matrix;
var _loc_5:Array;
var _loc_6:Array;
var _loc_7:Array;
_loc_2 = new Sprite();
_loc_2.graphics.lineStyle(1, BORDER_COLOR, 1, true, LineScaleMode.NONE);
_loc_2.graphics.beginFill(BORDER_COLOR);
_loc_2.graphics.drawRect(-0.1, -0.1, imageLoader.width, imageLoader.height);
_loc_2.graphics.endFill();
_loc_2.addChild(reflectionLoader);
_loc_2.y = reflectionLoader.height;
_loc_2.scaleY = -1;
_loc_2.filters = [DROPSHADOW];
_loc_3 = new Shape();
_loc_4 = new Matrix();
_loc_4.createGradientBox(_loc_2.width + 0, _loc_2.height + 2, Math.PI / 2, 0, 0);
//spiegel
_loc_5 = [9478873, 9478873];
_loc_6 = [0.0, 0.8];
_loc_7 = [0, 76];
_loc_3.graphics.lineStyle();
_loc_3.graphics.beginGradientFill(GradientType.LINEAR, _loc_5, _loc_6, _loc_7, _loc_4);
_loc_3.graphics.drawRect(0, 0, _loc_2.width + 5, _loc_2.height + 5);
_loc_3.graphics.endFill();
_loc_3.x = -5;
reflection = new Sprite();
reflection.addChild(_loc_2);
reflection.addChild(_loc_3);
reflection.x = -0.5 * reflectionLoader.width;
reflection.y = 4;
addChild(reflection);
return;
}// end function
private function fixImageURL(param1:String) : String
{
var _loc_2:String;
_loc_2 = IMAGE_SOURCE_PATTERN.exec(param1)[1];
_loc_2 = _loc_2.replace(SITB_STICKER_PATTERN, "");
_loc_2 = _loc_2.replace(DISCOUNT_STICKER_PATTERN, "");
return _loc_2;
}// end function
private function onRollOut(param1:MouseEvent) : void
{
var _loc_2:MultiPackCarousel;
image.filters = [DROPSHADOW];
_loc_2 = MultiPackCarousel(parent);
_loc_2.hideTitle();
return;
}// end function
private function onImageLoaded(param1:Event) : void
{
image = new Sprite();
image.graphics.lineStyle(1, BORDER_COLOR, 1, true, LineScaleMode.NONE);
image.graphics.beginFill(BORDER_COLOR);
image.graphics.drawRect(-0.5, -0.5, imageLoader.width, imageLoader.height);
image.graphics.endFill();
image.addChild(imageLoader);
image.x = -0.5 * imageLoader.width;
image.y = -imageLoader.height;
image.filters = [DROPSHADOW];
image.buttonMode = true;
image.addEventListener(MouseEvent.CLICK, onClick);
image.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
image.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addChild(image);
return;
}// end function
private function onClick(param1:MouseEvent) : void
{
navigateToURL(new URLRequest(link), "_self");
return;
}// end function
private function onRollOver(param1:MouseEvent) : void
{
var _loc_2:MultiPackCarousel;
image.filters = [DROPSHADOW, GLOW];
_loc_2 = MultiPackCarousel(parent);
_loc_2.showTitle(content, x);
return;
}// end function
}
}
und hier das ergebniss
http://www.hupsis-e107.de/theme/carussell/carusell.html
hier die as:
package
{
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
public class Item extends Sprite
{
private var imageURL:String;
private var reflectionLoader:Loader;
private var reflection:Sprite;
public var image:Sprite;
private var imageLoader:Loader;
public var content:String;
private var link:String;
private static var GLOW:GlowFilter = new GlowFilter(9478873, 1, 16, 16, 3, 2, false, false);
private static const BORDER_COLOR:uint = 9478873;
private static const SITB_STICKER_PATTERN:RegExp = /_PI[^_]+/;
private static var DROPSHADOWropShadowFilter = new DropShadowFilter(0, 0, 9478873);
private static const DISCOUNT_STICKER_PATTERN:RegExp = /_PE[^_]+/;
private static const IMAGE_SOURCE_PATTERN:RegExp = /src="([^"]*)"/;
public function Item(param1:String, param2:String, param3:String)
{
this.imageURL = fixImageURL(param1);
this.content = param2;
this.link = param3;
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
imageLoader.load(new URLRequest(imageURL));
reflectionLoader = new Loader();
reflectionLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onReflectionLoaded);
reflectionLoader.load(new URLRequest(imageURL));
return;
}// end function
private function onReflectionLoaded(param1:Event) : void
{
var _loc_2:Sprite;
var _loc_3:Shape;
var _loc_4:Matrix;
var _loc_5:Array;
var _loc_6:Array;
var _loc_7:Array;
_loc_2 = new Sprite();
_loc_2.graphics.lineStyle(1, BORDER_COLOR, 1, true, LineScaleMode.NONE);
_loc_2.graphics.beginFill(BORDER_COLOR);
_loc_2.graphics.drawRect(-0.1, -0.1, imageLoader.width, imageLoader.height);
_loc_2.graphics.endFill();
_loc_2.addChild(reflectionLoader);
_loc_2.y = reflectionLoader.height;
_loc_2.scaleY = -1;
_loc_2.filters = [DROPSHADOW];
_loc_3 = new Shape();
_loc_4 = new Matrix();
_loc_4.createGradientBox(_loc_2.width + 0, _loc_2.height + 2, Math.PI / 2, 0, 0);
//spiegel
_loc_5 = [9478873, 9478873];
_loc_6 = [0.0, 0.8];
_loc_7 = [0, 76];
_loc_3.graphics.lineStyle();
_loc_3.graphics.beginGradientFill(GradientType.LINEAR, _loc_5, _loc_6, _loc_7, _loc_4);
_loc_3.graphics.drawRect(0, 0, _loc_2.width + 5, _loc_2.height + 5);
_loc_3.graphics.endFill();
_loc_3.x = -5;
reflection = new Sprite();
reflection.addChild(_loc_2);
reflection.addChild(_loc_3);
reflection.x = -0.5 * reflectionLoader.width;
reflection.y = 4;
addChild(reflection);
return;
}// end function
private function fixImageURL(param1:String) : String
{
var _loc_2:String;
_loc_2 = IMAGE_SOURCE_PATTERN.exec(param1)[1];
_loc_2 = _loc_2.replace(SITB_STICKER_PATTERN, "");
_loc_2 = _loc_2.replace(DISCOUNT_STICKER_PATTERN, "");
return _loc_2;
}// end function
private function onRollOut(param1:MouseEvent) : void
{
var _loc_2:MultiPackCarousel;
image.filters = [DROPSHADOW];
_loc_2 = MultiPackCarousel(parent);
_loc_2.hideTitle();
return;
}// end function
private function onImageLoaded(param1:Event) : void
{
image = new Sprite();
image.graphics.lineStyle(1, BORDER_COLOR, 1, true, LineScaleMode.NONE);
image.graphics.beginFill(BORDER_COLOR);
image.graphics.drawRect(-0.5, -0.5, imageLoader.width, imageLoader.height);
image.graphics.endFill();
image.addChild(imageLoader);
image.x = -0.5 * imageLoader.width;
image.y = -imageLoader.height;
image.filters = [DROPSHADOW];
image.buttonMode = true;
image.addEventListener(MouseEvent.CLICK, onClick);
image.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
image.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addChild(image);
return;
}// end function
private function onClick(param1:MouseEvent) : void
{
navigateToURL(new URLRequest(link), "_self");
return;
}// end function
private function onRollOver(param1:MouseEvent) : void
{
var _loc_2:MultiPackCarousel;
image.filters = [DROPSHADOW, GLOW];
_loc_2 = MultiPackCarousel(parent);
_loc_2.showTitle(content, x);
return;
}// end function
}
}
und hier das ergebniss
http://www.hupsis-e107.de/theme/carussell/carusell.html