hi carl, i apologize for that confusing line that i posted what i mean is i replaced the sample text with an xml, for some odd reason the content will only show if blitmask is turned off
here is the code that im using
//xml//
var xmlFile:String="72kit.xml";
var contentXML:XML = new XML();
contentXML.ignoreWhitespace=true;
var contentXMLURL:URLRequest=new URLRequest(xmlFile);
var contentLoader:URLLoader=new URLLoader(contentXMLURL);
contentLoader.addEventListener(Event.COMPLETE, contentXMLLoaded);
function contentXMLLoaded(evt:Event):void {
contentXML=XML(evt.target.data);
var htmlContent=contentXML.content.text();
content_txt.htmlText=htmlContent;
}
contentLoader.load(contentXMLURL);
//throwprops//
var bounds:Rectangle = new Rectangle(30,84.4,425.95,630);
var mc:Sprite = new Sprite();
addChild(mc);
setupTextField(mc, bounds);
var blitMask:BlitMask = new BlitMask(mc, bounds.x, bounds.y, bounds.width, bounds.height, true);
var t1:uint, t2:uint, y1:Number, y2:Number, yOverlap:Number, yOffset:Number;
blitMask.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
TweenLite.killTweensOf(mc);
y1 = y2 = mc.y;
yOffset = this.mouseY - mc.y;
yOverlap = Math.max(0, mc.height - bounds.height);
t1 = t2 = getTimer();
mc.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
mc.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
}
function mouseMoveHandler(event:MouseEvent):void {
var y:Number = this.mouseY - yOffset;
//if mc's position exceeds the bounds, make it drag only half as far with each mouse movement (like iPhone/iPad behavior)
if (y > bounds.top) {
mc.y = (y + bounds.top) * 0.5;
} else if (y < bounds.top - yOverlap) {
mc.y = (y + bounds.top - yOverlap) * 0.5;
} else {
mc.y = y;
}
blitMask.update();
var t:uint = getTimer();
//if the frame rate is too high, we won't be able to track the velocity as well, so only update the values 20 times per second
if (t - t2 > 50) {
y2 = y1;
t2 = t1;
y1 = mc.y;
t1 = t;
}
event.updateAfterEvent();
}
function mouseUpHandler(event:MouseEvent):void {
mc.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
mc.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
var time:Number = (getTimer() - t2) / 1000;
var yVelocity:Number = (mc.y - y2) / time;
ThrowPropsPlugin.to(mc, {throwProps:{
y:{velocity:yVelocity, max:bounds.top, min:bounds.top - yOverlap, resistance:300}
}, onUpdate:blitMask.update, ease:Strong.easeOut
}, 10, 0.3, 1);
}
function setupTextField(container:Sprite, bounds:Rectangle, padding:Number=20):void {
var xmlText:String = "xml_test";
content_txt.width = bounds.width - padding;
content_txt.x = content_txt.y = padding / 2;
content_txt.htmlText = xmlText;
content_txt.autoSize = TextFieldAutoSize.LEFT;
container.addChild(content_txt);
container.x = bounds.x;
container.y = bounds.y;
};