-
[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.x = 300;
form.y = 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:
ReferenceError: Error #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)?
-
Senior Member
import fl.transitions.TransitionManager;
- The right of the People to create Flash movies shall not be infringed. -
-
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.
-
Senior Member
Can you show your class, otherwise it all guessing.
- The right of the People to create Flash movies shall not be infringed. -
-
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");
}
}
}
-
Senior Member
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. -
-
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:
1180: Call 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:
1046: Type was not found or was not a compile-time constant: TextField.
Last edited by simplexian; 04-27-2008 at 11:12 AM.
-
Senior Member
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. -
-
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:
ReferenceError: Error #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.
-
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|