Compatible with Flex 4.5?

Posted by krumedia 
Compatible with Flex 4.5?
May 18, 2011 08:04PM
Hi,

we are in trouble again. Flasheff doesn't seem to work with Flex SDK 4.5. Will there be an update?

For example the "1 Looping show-hide effect" sample project won't show anything if compiled with 4.5.
Re: Compatible with Flex 4.5?
May 19, 2011 11:37AM
I'm not sure if there will be another update in the near future, but there will be a new flasheff version (FlashEff 3.0) at the end of the year or in the beginning of the next year.
Anyway the package was already updated for version 4,so it's strange that it doesn't work with in 4.5. Perhaps you don't have the updated package, therefore try to download it again and see if the problem is still there.
Re: Compatible with Flex 4.5?
May 20, 2011 08:42PM
Hi kneo, we have the latest Flasheff. In the sample project the flash player stage remains white. But if i enable debug player's red redraw regions there is action going on.
Re: Compatible with Flex 4.5?
May 24, 2011 08:35AM
Well then it means that the package needs updates again. I cannot promise you anything about a new update in the next period, all our developers are working on other projects.
Re: Compatible with Flex 4.5?
June 01, 2011 09:33AM
Is there a chance you could provide resources (e.g. code of the component class) so we might have a look and are able to try working on a solution?
Re: Compatible with Flex 4.5?
June 02, 2011 12:47PM
Unfortunately, we can't give you the source code. However try to set the target only after ADDED_TO_STAGE event triggers.
See this [screencast.com]
Re: Compatible with Flex 4.5?
June 26, 2011 03:10AM
I'm also in 4.5 and hoping to use the text patterns. All the symbol patterns work for me, but not the text patterns. I set the ADDED_TO_STAGE code like your screenshot suggested, and the instance was definitely added to stage before setting the target, but still nothing showed up. FLASHEFFEvents.TRANSITION_END was triggered, so I assume something is happening, but it's not visible.
Re: Compatible with Flex 4.5?
June 29, 2011 07:14AM
Same problem with Flex 4.5. But Text patterns work for me and Symbol patterns NOT.
Re: Compatible with Flex 4.5?
June 29, 2011 09:41AM
Did you set the target it the ADDED_TO_STAGE event?
Re: Compatible with Flex 4.5?
July 05, 2011 02:19AM
I think we should be provided a solution to this. How would you make us wait until the end of year for a product we purchased? One of your developers should spend a day or two fixing the problem so everyone can use this with flash builder 4.5. I'm also pretty sure it's not something difficult to fix.

Here is my code: I don't even apply any filters or effects and still get a blank stage.

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="[ns.adobe.com];
		xmlns:s="library://ns.adobe.com/flex/spark"
		actionBarVisible="false" tabBarVisible="false">
	
	<s:Image id="Testme" x="291" y="158" width="48" height="48" source="res/folder.png" complete="loadComplete()" name="Testme"/>

	<fx:Script>
		<![CDATA[
			import FlashEff2Flex;
			
			import com.jumpeye.flashEff2.filter.dropShadow.FEFDropShadow;
			import com.jumpeye.flashEff2.filter.reflection.FEFReflection;
			
			import mx.core.UIComponent;
		
			
			private function loadComplete():void
			{
				
				var fe:FlashEff2Flex = new FlashEff2Flex();
				fe.showAutoPlay = true;
				addElement(fe);
				
				
				
			
				
				


				fe._targetInstanceName ="Testme";
				
				
				
			
				
				
			}
			
			
			
		]]>
	</fx:Script>

</s:View>



Edited 2 time(s). Last edit at 07/05/2011 02:22AM by user818901.
Re: Compatible with Flex 4.5?
July 05, 2011 06:49PM
I see you are trying to use this in a Spark View. I believe your issue and mine may be related. I am running an effect in a Spark TitleWindow that pops up via the PopUp Manager. The same code runs fine in the root application.

For a running example with view source enabled see this post.

You might try running your code in the root application to see if it runs any differently.
Re: Compatible with Flex 4.5?
July 05, 2011 06:54PM
I got it working yesterday. Thanks guys! I found an example that helped.

Here is my working code:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="[ns.adobe.com];
		xmlns:s="library://ns.adobe.com/flex/spark"
		actionBarVisible="false" tabBarVisible="false">
	<s:Image id="Testme" x="291" y="158" width="48" height="48" complete="loadComplete()"
			 name="Testme" rotationX="0" source="res/folder.png"/>

	<fx:Script>
		<![CDATA[
			import FlashEff2Flex;
			
			import com.jumpeye.flashEff2.filter.dropShadow.FEFDropShadow;
			import com.jumpeye.flashEff2.filter.reflection.FEFReflection;
		 
			import com.jumpeye.flashEff2.symbol.sparkle.FESSparkle;
			import mx.core.UIComponent;
		
			private var fe:FlashEff2Flex;
			
			private function loadComplete():void
			{
				setStyle("backgroundColor",0x000000); 

				
				 fe = new FlashEff2Flex();
				fe.addEventListener(Event.ADDED_TO_STAGE,init);
				addElement(fe);
			
				
			
			
				var pattern0:FESSparkle = new FESSparkle();
				pattern0.preset=3;
				pattern0.maximumParticleSize=4;
				pattern0.maximumParticleSpread=50;
				pattern0.particleDiversity=30;
				pattern0.particleEmissionInterval=0.3;
				pattern0.particleTweenDuration=1;
				pattern0.glowAmount=20;
				pattern0.glowColor=16777215;
				pattern0.emitterSize=0;
				pattern0.tweenDuration=1.5;
				pattern0.tweenType='Strong';
				pattern0.easeType='easeInOut';
				
				fe.showTransition=pattern0;
					




				
				
				
				
			
				
				
			}
			
			private function init(event:Event):void{
				
				fe._targetInstanceName ="Testme";
				
			}
			
		]]>
	</fx:Script>

</s:View>



Edited 1 time(s). Last edit at 07/05/2011 06:56PM by user818901.
Re: Compatible with Flex 4.5?
October 26, 2011 06:31PM
Hi,

I'm trying to create a Text effect on Flex 4.5 for a label.

Did someone make it work? could share an example code?

I tryed all code combinations i could imagine and have never been able to animate any text.

Tried with the last cost posted, uning my text animation, but didn't worked either. It gets inside the ADDED_TO_STAGE init function, but my text still stays there, as static as allways...:(

I thought i bought this software just for do this :(

At least i see i'm not alone...but knowing programmers are busy with another projects makes me wanna look for an "immediate refund" button around the site :S that won't stop me from loosing my project and my client anyway..

Thank you
David
Re: Compatible with Flex 4.5?
October 27, 2011 11:27AM
David,

Did you take a look at this post as well [www.flasheff.com] ? The solution from there surely should work even though you are trying to apply the effect on a textfield instead of an image.
Re: Compatible with Flex 4.5?
November 24, 2011 07:55PM
It seems Flasheff 2.0 does not work with the new text layout engine of Flash Player 10+. Therefore we have to work with the old TextField class.

You have to embed the font having the option embedAsCFF turned off.

// FlashEff2 setup
myFlashEff2.target = myOldTextField.textField;

public class OldTextField extends UIComponent // or SpriteVisualElement???
{
	private static const FREAKING_PADDING:Number = 2;
	private var _textField:TextField;
	public function get textField():TextField
	{
		return _textField;
	}
	public function get htmlText():String
	{
		return _textField.htmlText;
	}
	public function set htmlText(value:String):void
	{
		_textField.htmlText = value == null ? "" : value;
	}
	public function OldTextField() 
	{
		_textField = new TextField();
		_textField.multiline = true;
		_textField.wordWrap = true;
		_textField.embedFonts = true;
		_textField.selectable = false;
		_textField.mouseEnabled = false;
		_textField.antiAliasType = AntiAliasType.ADVANCED;
		_textField.gridFitType = GridFitType.PIXEL;
		var textFormat:TextFormat = new TextFormat();
		textFormat.font = "Verdana";
		textFormat.color = 0xff0000;
		textFormat.rightMargin = 2;
		textFormat.size = 12;
		_textField.defaultTextFormat = textFormat;
		addChild(_textField);
	}
	override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void 
	{
		super.updateDisplayList(unscaledWidth, unscaledHeight);
		_textField.x = -FREAKING_PADDING;
		_textField.y = -FREAKING_PADDING;
		_textField.width = unscaledWidth + FREAKING_PADDING + FREAKING_PADDING;
		_textField.height = unscaledHeight + FREAKING_PADDING + FREAKING_PADDING;
	}
}
Re: Compatible with Flex 4.5?
January 07, 2012 06:14AM
So, can someone confirm if the above post is accurate? That is, "Flasheff 2.0 does not work with the new text layout engine of Flash Player 10+. Therefore we have to work with the old TextField class." Will the above sample code do?
Re: Compatible with Flex 4.5?
January 07, 2012 11:15PM
No, the above solution didn't work for me either.
So far I have tried both TextField and UITextField on Flex 3 as well Flex 4.6 and none of them work with my Flash Player 10. I have also tried setting the target inside ADDED_TO_STAGE event and even that didn't work.
Re: Compatible with Flex 4.5?
January 10, 2012 06:31AM
The fonts have to be embedded (as pointed out to me by Florin). I managed to get the following code to work (embedded the fonts in two ways both of which work):

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="[www.adobe.com]; layout="absolute" xmlns:ns1="*" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]">
<mx:Button x="186" y="60" label="JumpEyeTest1" id="JumpEyeBtn1" click="onJumpEyeTest1()"/>
<mx:Button x="356" y="60" label="JumpEyeTest2" id="JumpEyeBtn2" click="onJumpEyeTest2()"/>
<mx:Style>
@font-face {
src: url("../libs/Arial.ttf");
fontFamily: Arial;
advancedAntiAliasing:true;
}
.myStyle{
fontFamily: Arial;
fontSize:52pt;
}
</mx:Style>
<mx:Script>
import mx.core.UITextFormat;
import mx.core.UITextField;
import mx.messaging.AbstractConsumer;
import mx.managers.PopUpManager;
import mx.containers.Box;
import mx.effects.Move;
import mx.effects.Glow;
import mx.effects.Fade;
import mx.effects.Parallel;
import mx.effects.Zoom;
import FlashEff2Flex;
import com.jumpeye.Events.FLASHEFFEvents;
import com.jumpeye.flashEff2.text.magneticWind.FETMagneticWind;

public var fe:FlashEff2Flex;
[Embed(source='../libs/verdana.ttf',
fontName='Verdana',
mimeType='application/x-font'
)]
public var font1:Class;

private function onJumpEyeTest1():void{
var movieTitle:UITextField;
var txtFormat:UITextFormat;

movieTitle = new UITextField();
movieTitle.embedFonts=true;
movieTitle.x= 200;
movieTitle.y=200;
movieTitle.width = 200;
movieTitle.text = "TRY TO TEST THIS";
movieTitle.textColor=0;

txtFormat= new UITextFormat(this.systemManager);
var myFont:Font = new font1();
txtFormat.font= myFont.fontName;
var b1:Boolean = Application.application.systemManager.isFontFaceEmbedded(txtFormat);
movieTitle.setTextFormat(txtFormat);
movieTitle.defaultTextFormat=txtFormat;

fe = new FlashEff2Flex();
fe.addEventListener(FLASHEFFEvents.INIT, eventInit);
fe.addEventListener(Event.ADDED_TO_STAGE, stageInit);
fe.showAutoPlay=true;
fe.visible=true;

this.addChild(movieTitle);
this.addChild(fe);

var showEffect:FETMagneticWind = new FETMagneticWind();
showEffect.randomX = 200;
showEffect.randomY = 50;
showEffect.groupDuration = 1.5;
showEffect.tweenDuration = 2;
fe.target = movieTitle;
fe.showTransition=showEffect;
fe.show();
}

private function onJumpEyeTest2():void{
var movieTitle:UITextField;
var txtFormat:UITextFormat;

movieTitle = new UITextField();
movieTitle.embedFonts=true;
movieTitle.x= 200;
movieTitle.y=250;
movieTitle.width = 200;
movieTitle.text = "TRY TO TEST THIS";
movieTitle.textColor=0;

txtFormat= new UITextFormat(this.systemManager);
txtFormat.font= "Arial";
var b1:Boolean = Application.application.systemManager.isFontFaceEmbedded(txtFormat);
movieTitle.setTextFormat(txtFormat);

fe = new FlashEff2Flex();
fe.addEventListener(FLASHEFFEvents.INIT, eventInit);
fe.addEventListener(Event.ADDED_TO_STAGE, stageInit);
fe.showAutoPlay=true;
fe.visible=true;

this.addChild(movieTitle);
this.addChild(fe);

var showEffect:FETMagneticWind = new FETMagneticWind();
showEffect.randomX = 200;
showEffect.randomY = 50;
showEffect.groupDuration = 1.5;
showEffect.tweenDuration = 2;
fe.target = movieTitle;
fe.showTransition=showEffect;
fe.show();
}

private function eventInit():void{
}

private function stageInit(event:Event):void{
}
</mx:Script>
</mx:Application>
Sorry, you do not have permission to post/reply in this forum.