Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6755805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:26:48+00:00 2026-05-26T13:26:48+00:00

I think i have the most common actionscript error.In the code below i have

  • 0

I think i have the most common actionscript error.In the code below i have a MovieClip with some TextFields inside and i want to animate them.When i assign the class to the MovieClip i get this error 1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.text:TextField.. When i trace the childs i get [Object TextField] and the code works fine if i place it on the first frame and apply it to a Dynamic Text so why i get this error when i try to apply this code to the childs of a MovieClip ?

Is there a chance to have forgot to import any necessary library ?

I have made the TextFields dynamic,i have embed the characters and set anti-alias for animation.

package AScripts
{

import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import com.greensock.*;
import com.greensock.easing.*;
import flupie.textanim.*;

public class TextFade extends MovieClip {
    private var child : Object;

    public function TextFade( )     
    {
        /*    for (var i : int = 0; i < numChildren; i++  )  {
              child = getChildAt( i );
              trace( child );  
        */
            child = getChildAt( 0 );
            var txtanim:TextAnim = new TextAnim( child ); // <-- Error
                            /* TextAnim expects a TextField as argument */
            txtanim.mode = TextAnimMode.RANDOM;
            txtanim.split = TextAnimSplit.WORDS;
            txtanim.effects = myEffect;
            txtanim.start();
    }
    function myEffect( block:TextAnimBlock ) : void
    {
        TweenLite.to( block , .5 , {alpha : 0 , delay : Math.random( ) * 1 } );
    }   
  }
}

UPDATE : I made the suggestion changes and worked.

import flash.text.*;
private var child : TextField;
child = getChildAt( i ) as TextField;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:26:48+00:00Added an answer on May 26, 2026 at 1:26 pm

    Try this:

    try 
    {
        // Need to explicitly cast the child to TextField otherwise
        // we are making an implicit cast and will get an error.
        var textField:TextField = child as TextField; 
        var txtanim:TextAnim = new TextAnim( textField); 
    } 
    catch (error) 
    {
        // unable to cast to a textfield, handle this error if necessary.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have what I would think is the most common case for processing a
I think this is a common scenario - I have a view where I
I'm trying to have a list of all the most common time zones for
By far, the most common class of errors I have are issues with the
This probably isn't the most common filename parsing problem, but I have a program
What are the most useful media=print -specific, cross-browser-compatible CSS properties? I think we have
This seems like the most common relationship but for some reason I cannot get
In most of the web application, i have seen one base class consisting common
I have a solid understanding of most OOP theory but the one thing that
I think I have a solution to this, but is there a better way,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.