text effect position defaulting to x=0, y=0

Posted by illegal 
text effect position defaulting to x=0, y=0
March 22, 2010 05:38PM
Hi,

Having an issue with an AIR application with an AS3 FlashEff2Code component which is document class project. I've installed the AIR application on a both a Mac osx and windows xp machine. The FlashEff2Code text field displayObject is defaulting to the upper left corner of the stage. (0,0).

Testing the .SWF which is include in the .AIR application. the FlashEff2Code text field is correctly position at (330, 60).

I'm doing something wrong. Not sure what to do.

Below is the code in QuizQuestion.as which is called for each question in the QuizApp document class.

//create and position the textfield (question):
			questionField = new TextField();
			questionField.text = question;//param1
			questionField.autoSize = TextFieldAutoSize.LEFT;
			questionField.wordWrap = true;
			questionField.x = questionX;//330
			questionField.y = questionY;//60
            questionField.width = 925;
			questionField.name = "question";
			var question_format:TextFormat = new TextFormat();
			question_format.color = 0xFFFFFF;
			question_format.font = "Arial";
			question_format.size = 35;
			questionField.setTextFormat (question_format);
			addChild (questionField);
			//create effect
			txtEffect = new FlashEff2();
			//effect not to autoplay
			txtEffect.showAutoPlay = false;
			// The text field should not be visible before the show effect starts.
			txtEffect.targetVisibility = false;
			//txtEffect.x = questionX;//testing
			//txtEffect.y = questionY;//testing
			//add object to stage
			addChild(txtEffect);
			// The target object (question) and the FlashEff2 component instance (txtEffect) must be
			// already added to the display list when the _targetInstanceName property is set.
			txtEffect._targetInstanceName = "question";
			
			// Create the show effect and customize them to your needs. The effect
			// properties always belong to the FlashEff2 patterns and not the FlashEff2 component.
			if (theTitleEffect == "FETBubbleScale") {		
				// The show FlashEff2 patterns 
				var bubbleScale_txt_pattern:FETBubbleScale = new FETBubbleScale();
				bubbleScale_txt_pattern.preset=19;
				bubbleScale_txt_pattern.maxBlurX=50;
				bubbleScale_txt_pattern.maxBlurY=10;
				bubbleScale_txt_pattern.maxScaleX=5;
				bubbleScale_txt_pattern.maxScaleY=5;
				bubbleScale_txt_pattern.groupDuration=0.7;
				bubbleScale_txt_pattern.partialGroup='letters';
				bubbleScale_txt_pattern.partialPercent=100;
				bubbleScale_txt_pattern.partialBlurAmount=0;
				bubbleScale_txt_pattern.partialStart=50;
				bubbleScale_txt_pattern.tweenDuration=1.4;
				bubbleScale_txt_pattern.tweenType='Elastic';
				bubbleScale_txt_pattern.easeType='easeOut';
				// set the show effects.
				txtEffect.showTransition = bubbleScale_txt_pattern;

Thanks



Edited 1 time(s). Last edit at 03/22/2010 05:40PM by illegal.
Re: text effect position defaulting to x=0, y=0
March 22, 2010 06:26PM
Solved it!

I created a movie clip at (330,60) then added the text field and text effect to it. I know it had something to do with FlashEff swapping depths or removing then re adding the text field or movie clip. So i refined this process into a movieclip and not directly to the stage or other objects at (0,0).

question_mc = new MovieClip();
			question_mc.x = 330;
			question_mc.y = 60;
			question_mc.name = "question_mc";
			addChild(question_mc);


//then
//add object to stage
			this.question_mc.addChild(questionField);
			this.question_mc.addChild(txtEffect);



Edited 1 time(s). Last edit at 03/22/2010 06:27PM by illegal.
Sorry, you do not have permission to post/reply in this forum.