Jump to content
Sign in to follow this  
music_lp90

Flash Dynamic Text Fade Issue

Recommended Posts

Hi all,A while ago, I created a flash file for reading testimonials from an xml document and fading the testimonials in and out. I would like to use it now, but the text is stretched out. The text gets loaded into a dynamic text box that is inside a movie clip. The movie clip is set on the timeline to fade in and out and just keeps looping. At the beginning of each loop, a new testimonial is loaded in while the alpha is at 0% and not visible. The original dynamic text box was sized to take up the whole stage area (I think it's called a stage in Flash. Maybe canvas or something.) and fades in and out beautifully, except that the text is stretched. So, to fix that, instead of sizing the dynamic text box, I replaced it with a new dynamic text box that stretches to however much text is in it. Now the text shows up nicely. It is not stretched, but for some reason it does not fade in and out like the previous text. I put it inside of the same movie clip, deleted the stretched dynamic text box, and gave the new text box the same instance name as the one it is replacing. All other settings on the text box appear to be the same. I am at a loss for why it will not fade in and out. Any ideas on what else I might need to look into to get the new text box to behave as the old one did?Here's the actionscript if it's any help:On frame 2 (majority of script)

mc_contain.mc_text.autoSize = 'none';var my_xml:XML = new XML();my_xml.ignoreWhite = true;my_xml.onLoad = function(success){	if (success){		//Load the testimonials into an array to be looped through and displayed in intervals		var xmlTestimonials = my_xml.firstChild.childNodes;		var numTestimonials = xmlTestimonials.length;		//mc_contain.mc_text.text = xmlTestimonials[0].attributes.Content;	}	loop();	function loop(){		mc_contain.mc_text.text = xmlTestimonials[i].attributes.Content;		_global.i++;		if(_global.i >= numTestimonials){			_global.i=0;		}	}}var loadFile = "testimonials.xml";my_xml.load(loadFile);mc_contain.onRelease("");mc_contain.onPress = function() { getURL("http://url", "_self");};

frame one picks a random place to start:

function randRange(min:Number, max:Number):Number {    var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;    return randomNum;}_global.i = randRange(0, 29);

Frame 229 sends back to frame 2 to load next testimonial:

gotoAndPlay(2);

Thanks for looking!

Edited by music_lp90

Share this post


Link to post
Share on other sites

In case anyone else is having this problem, it was because I did not embed the font with the new dynamic text box I made. In order for any tweens or color effects to work on dynamic text boxes you must choose to embed the font in the text box's properties tab.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...