Copy link to clipboard
Copied
Hello,
I'm using the Animate CC timeline to create animated textfields.
Up to now I'm able to change content of dynamic textfields on the fly by inserting keyframes on a "actions" layer and writing this to actions:
--------------------------------------------
this.textBox01_txt.text = 'new text';
--------------------------------------------
In this case the animation still works.
As long as I don't use externally linked textfile the animation will play fine.
But if I try to load an external textfile into the textfield, the text will be displayed statically on the start position of the animation, while the other animations
in the background are running fine. The animation of that layer does not work with external file?!
I couldn't find any workaround for this in the internet.
Maybe someone can help me out.
This is my action that I have placed at the very first frame.
--------------------------------------
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
var testTextLoader:URLLoader = new URLLoader();
testTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void{
textBox01_txt.text = e.target.data;
addChild(textBox01_txt);
}
testTextLoader.load(new URLRequest("mytext.txt"));
---------------------------------------
Actually, I think the addChild(textBox01_txt) is the problem. Try removing that line...
Copy link to clipboard
Copied
there's no problem with your code (assuming that .txt file exists in the correct location and your textfield exists on stage).
Copy link to clipboard
Copied
I know there is no problem with code.
it works, but if I use external text the animation does not work. it just displays text without the movement.
Copy link to clipboard
Copied
I would suggest ditching the timeline animation and using TweenMax/Lite from Greensock. You have a lot more control and it's also a lot easier to change timing and such.
Copy link to clipboard
Copied
there's nothing in your code related to any animation including addChild (unless that textfield's on a layer with animation, which wouldn't make any sense).
Copy link to clipboard
Copied
Using addChild() on something already on stage doesn't make any sense... and the OP mentions using keyframes to animate with. I tried the code on a text field, on stage, with two keyframes... it just sat there. I removed the addChild and it worked/animated properly.
Copy link to clipboard
Copied
Actually, I think the addChild(textBox01_txt) is the problem. Try removing that line...
Copy link to clipboard
Copied
Thank you all for your support!!!
specially @dmennenoh !!!