• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Load external textfile into animated textfield stops animation.

Community Beginner ,
Oct 31, 2017 Oct 31, 2017

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"));

---------------------------------------

TOPICS
ActionScript

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Oct 31, 2017 Oct 31, 2017

Actually, I think the addChild(textBox01_txt) is the problem. Try removing that line...

Votes

Translate

Translate
Community Expert ,
Oct 31, 2017 Oct 31, 2017

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 31, 2017 Oct 31, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 31, 2017 Oct 31, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2017 Oct 31, 2017

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 01, 2017 Nov 01, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 31, 2017 Oct 31, 2017

Copy link to clipboard

Copied

Actually, I think the addChild(textBox01_txt) is the problem. Try removing that line...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

LATEST

Thank you all for your support!!!

specially @dmennenoh !!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines