dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: [RESOLVED] Using transition manager for custom class (movieclip);

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    65

    resolved [RESOLVED] Using transition manager for custom class (movieclip);

    Having an issue, because I don't really understand how it works. I have a custom class called EmailForm, which is a email form movieclip. Now, I am having no trouble getting it on the stage...

    [PHP]
    PHP Code:
    var form:EmailForm = new EmailForm();
    form.300;
    form.300;
    addChild(form);
    // TransitionManager.start(form, {
                        // type:Fade,
                        // direction:Transition.IN,
                        //duration:1,
                         // easing:Strong.easeInOut
                        // }); 
    ...however, if I try to use the transition manager, it throws the following error:

    PHP Code:
    ReferenceErrorError #1069: Property __transitionManager not found on Web.EmailForm and there is no default value.
        
    at fl.transitions::TransitionManager$/start()
        
    at Web::Website() 
    What do I need to do to my custom class (EmailForm.as)?

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    import fl.transitions.TransitionManager;
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    65
    That class has been imported into both my EmailForm.as, and Website.as (main document class), it still generates that error.
    Last edited by simplexian; 04-26-2008 at 05:42 PM.

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Can you show your class, otherwise it all guessing.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  5. #5
    Member
    Join Date
    Sep 2007
    Posts
    65
    There really isn't anything in it. It's linkage is to a movie clip in my library, exported for actionscript. It allows me to put it on the stage, move it around... confused why it won't let me apply a transition effect.

    Clearly, I am new.

    PHP Code:
    package Web {
        
    import flash.display.*;
        
    import fl.transitions.easing.*;
        
    import fl.transitions.TransitionManager;
        
    import flash.text.*
        public class 
    EmailForm extends MovieClip {
            public function 
    EmailForm() {
                
    trace("Form added");
            }
        }


  6. #6
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You see now it becomes clear. You need to import the TransitionManager class in your fla file and not in the email form. You are not using it in the email form, so you can delete all the reference to it there.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  7. #7
    Member
    Join Date
    Sep 2007
    Posts
    65
    If I try to import that class into my .fla file, it generates this error. Actually, when I put anything in the .fla file, it generates the same error.

    PHP Code:
    1180Call to a possibly undefined method addFrameScript 
    on Website.as Line 1, package web {

    Clearly, I am misunderstanding how .as files exactly work, or how to correctly use them in conjunction with the .fla file. Assuming that my two classes, Web.Website, and Web.EmailForm are written as such, how do I dispose of this error and get variable form transitioned?

    PHP Code:
    package Web {
        
    import flash.display.*;
        public class 
    Website extends Sprite {
            public function 
    Website() {
                
    trace("Main document class");
                var 
    form:EmailForm = new EmailForm();
                
    addChild(form);
            }
        }
    }

    package Web {
        
    import flash.display.*;
        
    import flash.text.*
        public class 
    EmailForm extends MovieClip {
            public function 
    EmailForm() {
                
    trace("EmailForm class");
            }
        }

    And second, out of curiousity, why does my EmailForm class require me to import flash.text, whereas Website does not? (It otherwise throws the following error on every line of code within the .as file...

    PHP Code:
    1046Type was not found or was not a compile-time constantTextField
    Last edited by simplexian; 04-27-2008 at 11:12 AM.

  8. #8
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Because you are extending the Sprite class, which does not have a timeline. You need to extend the MovieClip class, if you have scripts in frames.

    Your email form probably contains a textfield.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  9. #9
    Member
    Join Date
    Sep 2007
    Posts
    65
    Cancer...

    PHP Code:
    import fl.transitions.TransitionManager
    is now in my Website.fla, my main document class Website.as, and my EmailForm.as file...

    And with the extension changed to MovieClip from Sprite, it still gives me the following error...

    PHP Code:
    ReferenceErrorError #1069: Property __transitionManager not found on Web.EmailForm and there is no default value.
        
    at fl.transitions::TransitionManager$/start()
        
    at Web::Website() 
    So... still unable to transition form with following code:

    PHP Code:
    package Web {
        
    import flash.display.*;
        
    import fl.transitions.*;
        
    import fl.transitions.easing.*;
        
    import fl.transitions.TransitionManager;
        public class 
    Website extends MovieClip {
            public function 
    Website() {
                
    trace("Main document class");
                var 
    form:EmailForm = new EmailForm();
                
    addChild(form);
                
    TransitionManager.start(form, {
                                            
    type:Fade,
                                            
    direction:Transition.IN,
                                            
    duration:1,
                                            
    easing:Strong.easeInOut
                                            
    });
            }
        }
    }

    package Web {
        
    import flash.display.*;
        
    import flash.text.*
        
    import fl.transitions.*;
        
    import fl.transitions.easing.*;
        
    import fl.transitions.TransitionManager;
        public class 
    EmailForm extends MovieClip {
            public function 
    EmailForm() {
                
    trace("EmailForm class");
            }
        }
    }

    //(On my Website.fla file, Line 1, Frame 1)
    import fl.transitions.TransitionManager
    Headache!
    Last edited by simplexian; 04-27-2008 at 04:54 PM.

  10. #10
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Although I do not typically deal with animation/tweening/transitions whatevers, I looked into the error message you're getting.

    This page on actionscript.org indicates that the target must be dynamic.
    http://www.actionscript.org/forums/s....php3?t=146259

    Code:
    public dynamic class EmailForm extends MovieClip
    EmailForm could extend Sprite instead, I think.

  11. #11
    Member
    Join Date
    Sep 2007
    Posts
    65
    5tons, that was exactly the problem. Is there a good reference that explains the differences between non-dynamic and dynamic classes?

    Thanks again 5 tons and cancer.
    Last edited by simplexian; 04-27-2008 at 07:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center