Movie clips inside an animated movieclip
Hello- I have been trying to get movieclip buttons inside an
action script animated movie clip to work and have no luck doing
so. The inside movieclips act as if they dont have over or out
states; but when i comment out the animation, they work fine...
here is my code- (Please note im am a newbe at action script so any
suggestions on improving current code will be greatly appreciated)
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
function upFunction() {
var xPosT:Tween = new Tween(kText, "_x", Strong.easeOut,
kText._x, 400, 1, true);
function downFunction() {
var xPosT:Tween = new Tween(kText, "_x", Strong.easeOut,
kText._x, 200, 1, true);
kText.btn.onRelease = function():Void {
_root.play();
kText.onRollOver = function():Void {
upFunction();
kText.useHandCursor = false;
kText.onRollOut = function():Void {
downFunction();
kText is the animated movieclip, btn is the button inside
kText
Thanks!
if you define any mouse handlers for a parent movieclip (like
kText) it will intercept all mouse events so child movieclips (like
kText.btn) do not see the mouse events.
to remedy define all mouse handlers for shapes (converted to
movieclips), buttons and movieclips on kText's timeline or use a
loop with hitTest one the parent or child
Similar Messages
-
Movie clip inside a movie clip
Hi everybody,
I'm creating a slideshow with Flash, like the ones done with Powerpoint. I would like to create a movie clip inside another movie clip, that is, say I have a clip called button1, and when I click it, frame number 2 in this clip is displayed, and then more information appears. Inside this frame 2, there are other clips, for example an X button to close and return to frame number 1 in the clip button1, as the image shows:
What I have done is convert the button1 text into a movie clip, and assign an action to it:
on (press){
gotoAndStop(2);
When frame 2 is displayed, I would like to click to the X-button to get back to frame number1, so what I've done is, again, convert it into a movie clip and assign the following action:
on (press){
_root.gotoAndStop(1);
But this doesn't work. I've been trying as well changing other things, but no way... At first I thought it had something to do with the _root or _parent, but now it looks as when using gotoAndStop in the "parent" button (button1), no actions work for the "child" buttons.
I've loaded the fla and the swf files here, just in case someone would like to check.
Thank you very much in advance for your help. I've been checking other posts, but apparently I couldn't find the appropriate info."_root" is only used to reference the very first level of your flash file. Right now you are telling flash to go to the second frame in your root timeline but you want to go to the second frame in your button1 timeline.
Change the code that is on the X-button to
on(press){
gotoAndStop(1);
Remove the "_root" and it should work.
If it still doesn't work, make sure the button has an instance name of "button1" and use this code.
on(press){
_root.button1.gotoAndStop(1);
This is using "_root.button1" as the 'address' of your movieclip and it wont matter where the code is. -
Access Movie clip inside Button
Is there a way to access a movie clip inside a buttion?
I have a bunch of images in a movie clip, and I want to have the same mc to change frames in different button symbols. But when try to talk to it myButton.myMovieClip.gotoAndStop(3);
It gives me and error.
1119: Access of possibly undefined property myMovieClip through a reference with static type flash.display:SimpleButton.no.
use a movieclip button. -
How can I make the Instance name the same as the name of the Movie clip in an animation.
Hi, I am an animator for a small game project and I have this really big problem. Even though I used flash for animation for a long time I am a newbie when it comes to something technical. I just received a request to make every movie clip that I use to have a consistent <Instance name> in every frame of the animation. Only if they told me this earlier... Is there an easier way to make the <Instance name> the same as the name of the Movie clip used other than manually entering it. I have 16 characters with 12 body parts with 20 animations each with about 6-7 frames for each body part it will take me months and nightmares evey night to enter everything by hand. Please help me keep my sanity!
I'm not sure if I explain correctly, so here is a picture:
Thank you!Thank you for the fast answer! I found this video on jsfl functionality that deals with a similar problem, I am not a coder so it will take me some time to figure it out, but when I do I will probably post the answer here. Here is the video:
-
Unable to expand movie clip inside of scroll
I inherited a .fla file with a scrolling thumbnail image
movie clip that moves horizontally inside of a "scroll" behind a
mask, with the use of right and left buttons. < > The
thumbnail movie clip is much wider than the movie's dimensions. I
think it was made in Flash 5. I added about 30 new thumbnails to
the movie clip for my client, but now it won't expand anymore.
Before, all I had to do was put the thumbnail into the edge of the
clip and it would expand to include it. I can get the invisible
right and left "scroll" movie clips to scroll even beyond the movie
clip by adjusting the numbers in the ActionScript for those two
instances. I am not a "programmer type" so this probably is hard to
understand. If I try to change the width of the movie clip in the
properties box it comes up with an "invalid size and position"
error. Actually I think all it would do is stretch-distort the clip
anyway, which is not what I want. (if I put in a lesser number it
squishes the clip). I just want more space right and left.
Any ideas?
-SueHow do I attach a file to this? All I see is a button to
attach code. Sorry, I've rarely use this forum.
-Sue -
How to print a Movie clip inside uiLoader?
Hi,
I;m making a flash application in AS3, and I've got a little problem.
Which is here...
Here is my code....
/* Print Button Function Here.....*/
print_btn.addEventListener(MouseEvent.CLICK,printPage);
function printPage(evt:MouseEvent) {
var printJob:PrintJob = new PrintJob();
if (printJob.start()) {
if (uiLoader.source.width>printJob.pageWidth) {
uiLoader.source.width=printJob.pageWidth;
uiLoader.source.scaleY=uiLoader.source.scaleX;
printJob.addPage(uiLoader.source); <------------ Error shows Here
printJob.send();
Actually I have a movie clip which contains a Print Button and a uiloader.
uiloader loads differnt external movies.
I applied a code to Print button to print those movies.
But FlashProgram shows an error.
which is Here....
Scene 1, Layer 'Actions', Frame 2, Line 174
1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:Sprite.
Please tell me how to fix it.
thank you...Thank you very much it's been really helpfull.
Now it's working but there are two more issues which i want to dicuss now.
1st issue is, it print the both movies (main movie & external both) but i only want to print that one which inside the uiloader only.
2nd issue is, actually this application which I'm making is for users to apply various paints on roofs and walls to check how they looks.
The issue is it only print the actual movie colors not those colors which have been currently applied. Or what i'm trying to say is that, " how can I print uiloader source movie with it's current colors settings?"
thank you. -
Movie Clip VS. Animated Graphic
What is the difference between an animated graphic and a
movie clip? Why would you use one over the other?
Thanks.quote:
Originally posted by:
dzedward
if you're using the Tween class, listen for onMotionFinish
(as2) or MOTION_FINISH (as3) to start the tween over.
no, my movie clip was animated by using for loop. What I want
to do is no matter where I put my movie clip, it will contnuously
move from left to right. -
Target a movie clip inside a movie clip
When I go to the symbol editing mode on the first movie clip, I drag the instance of my 2nd movie clip to the stage. I then am duplicating my work, (it is over lapping) not sure what I am doing wrong here? and I am finding that my child movie clip is taking on the parent movie clip properties. How do I stop this from happening? I thought they are to remain independent? Any help is greatly appreciated. TY.
Will the child timeline be independent of the parent timeline. My pend_mc is the child and has taken on the hand_mc properties. Also why is there brackets around some and not the others? Thank you so much for your time.
-
AS2 setMask: can a mask be a movie clip composed of child movieclips?
Hi,
I create dynamically a empty movieclip and attach to it
several movieclips
symbols from the library and call it "mcMask".
Then I try to mask another dynamicaly created movieclip
called "mc" using :
mc.setMask(mcMask).
But it only partially works (some child clips of mcMask
actually mask mc,
but others don't).
Why?
Can't setMask work with a mask composed of child movieclips?
Thanks for your help.
HenriPArt of the problem will be due to declaring the uiLoader inside of a function. When you do that you limit its scope to within that function. You should declare it outside of any function if you need to access it in more than one function.
import flash.events.MouseEvent;
import fl.motion.MotionEvent;
var uiLoader:UILoader;
var targetObj:Object;
The other problems I see regard the line you point to. It is not spelling the name the same, using a lowercase "l". Also, if you want to target what the UILoader contains, you should target its "content" property, as in...
targetObj = uiLoader.content.mask_01 -
Targeting a movie clip inside a movie clip inside another movie clip with a twist
Thanks to ned. Im able to link to a movieclip inside a movieclip.
Unfortunately one of the movieclips now are a scrollbar and scroll. Now the actionscript isnt working?
Has anyone wany ideas? Please
cal.onPress = function() {
gotoAndPlay(2);
message1.contentMain.message.total = unit1;
ThanksI wish i could say it wasnt named message 1 but it is. The code works without a scroll bar.
As soon as i put the target in a scrollbar it doesnt work?
This is my code for the scrollbar if thats the problem? maybe
scrolling = function () {
var scrollHeight:Number = scrollTrack._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrack._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._y;
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain._y = Math.round(dy*-1*moveVal+initContentPos);
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y+speed<maskedView._y) {
if (scrollFace._y<=top) {
scrollFace._y = top;
} else {
scrollFace._y -= speed/moveVal;
contentMain._y += speed;
} else {
scrollFace._y = top;
contentMain._y = maskedView._y;
delete this.onEnterFrame;
btnUp.onDragOut = function() {
delete this.onEnterFrame;
btnUp.onRelease = function() {
delete this.onEnterFrame;
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y-speed>finalContentPos) {
if (scrollFace._y>=bottom) {
scrollFace._y = bottom;
} else {
scrollFace._y += speed/moveVal;
contentMain._y -= speed;
} else {
scrollFace._y = bottom;
contentMain._y = finalContentPos;
delete this.onEnterFrame;
btnDown.onRelease = function() {
delete this.onEnterFrame;
btnDown.onDragOut = function() {
delete this.onEnterFrame;
if (contentHeight<maskHeight) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
scrolling(); -
Pause & Play Animation When i'm using movie clips- filters
Pause & Play Animation When i am using movie clips-
filters
Graphic and movieclips are using for my animation
When i Press the pause the movieclip animation not stopped.
Any way to apply the filters on graphic
I want to apply the filters for particular graphics or movie
clips. with navigational button working.
Please help me.
Thanks
S.Satheesh KumarAudio on the timeline, especially stream, tends to play very reliably. Is this project under any NDA or can you provide a FLA to examine? Let me know if you want to private message it and I'll shoot you a message.
What version of Flash Player are you targeting and is this AS2 or AS3? -
How to play a movie clip with a tween animation
I created a movie clip symbol with a tween animation and created an instance of it on the main stage. The animation is in the movie clip timeline, not on the main timeline. I cannot get the mc to play using mc.play() or mc.gotoAndPlay. What am I missing??
Hi Ned, thanks for the response;
1.Yes I named the instance.
2.I don't beleive so. I started from the library creating a new symbol, added the graphics, added the key frames, then created the tween. Then I dragged the symbol onto the main stage and named the instance. So I don't think there is a movie clip inside an mc.
Here is the main timline:
Here is the mc timeline:
Here is what I'm trying to do:
stop();
blk1._visible = false;
blk2._visible = false;
blk3._visible = false;
ppk1._visible = false;
ppk2._visible = false;
ppk3._visible = false;
storeCartons = new Array();
storeCartons = [blk1, blk2, blk3, ppk1, ppk2, ppk3];
startButton.onRelease = function() {
myNumber = Math.floor(Math.random()*storeCartons.length);
trace("myNumber "+myNumber);
activeCarton = storeCartons[myNumber];
activeCarton._visible = true;
activeCarton.play(); -
How do i reference a movie clip instance name from inside child movie clips.
I have a label I am referencing form a movie clip inside the movie clip which contains the "label_2."
Here is the code I used:
MovieClip(parent.parent).gotoAndPlay("return_2");
Now I need to reference a instance name of a movie clip in side the same scene.
What would the code be?You should probably start by reading the docs and/or google:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.html
http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7fca.html
http://www.google.com/search?hl=en&q=AS3+events
Once you got the basics down, look into creating/using your own custom events:
http://www.google.com/search?hl=en&q=AS3++custom+events
http://www.adobe.com/devnet/actionscript/articles/event_handling_as3.html
Event dispatching and event handling is one of the most important things about ActionScript. The sooner you get into them, the better. -
Menu made in movie clip - with sub-section we can click on to go to another frame
I would like some help about that:
I want to do a menu made all in movie clip (NO button). In
this menu, when we click on one of the part (sub-section) of the
button (which is a mc), we must go to another frame in the main
scene.
It is working for the roll-over and mousedown for my button
(with the _up, _over and _down labels). But it's not working then
to put, i don't know, another movie clip inside with alpha 0 to
make another onRelease and then gotoAndStop(20); ...
Here is the code I have in the main scene (first frame):
stop();
mon_clip_mc.onRelease = function() {
//this._root.gotoAndStop(20);
And here is the code I have in the first frame of the movie
clip of the button:
stop();
I'd really appreciate some help! Thanxlalapinerouge,
as far as I can see with your method for buttons, is that it
only reads 1 button inside mon_clip_mc..
I cant figure out why, i've tested it over, made new fla's
with your method, and i still cant get it to work, nor do I
understand why..
I need to study abit more.
Maybe someone in the Forum will have a look at this topic,
and know what's going on with your method.
In the mean time, heres a submenu I made for a site a while
ago. This doesnt use timeline actionscript, ( because i was a
newbie then ) =)
if you have a look through the whole FLA, ( it's quite abit)
you can get an Idea of how i do my movie clip buttons, till this
day, i still use the same method, only i use mainly timeline
actionscript..
the main point to notice is that EVERY button ( even submenu
) is it's own movieclip...no button in there holds multiple sub
buttons inside... This gives you complete control of each button,
and endless possibilities for animation, tweens, and anything extra
you would want to add to a button.
Sorry I couldnt help you figure out your problem fully. Im
still going to mess around with it abit more to see if i can figure
it out..
Hope you can addopt some useful info from this FLA.
HERE -
Movie Clip Button - Action Script issues
This is a two part question:
1. I have my movie clip button, "mcAboutus" then inside my
movie clip I have 5 layers: actions, labels, text, animated
rollover("mcAboutusover"), animated rolloff("mcAboutusoff"). On the
labels layer I have _up, _over, _off. On the _up is the text layer,
on the _over is a movie clip of the animated
rollover("mcAboutusover") which is 90 frames, and I want to loop as
long as the mouse is over the text. And the _off has the
"mcAboutusoff" movie clip.
So I was able to have the rollover work, but when I roll off
the rollover animation continues on until the end of the animation.
I understand it has to do with the fact that it's a movie clip, but
how do I point it to go into the movie clip and read the animation
and that on the last frame of the animation I have a
"gotoAndPlay(1);" to have the animation continue looping as long as
it's in a rollover state?
here is the code I have for the _root:
this.mcAboutus.onRollOver = function() {
mcAboutus.gotoAndPlay(_over);
this.mcAboutus.onRollOut = function() {
mcAboutus.gotoAndPlay(_off);
The other problem I am having is that once the I have rolled
over the animation once, the button dies and won't let me rollover
it again?
Aside from the "stop();" action in the mcAboutus movie clip
symbol, I don't have any other actions, should I put items in the
different movie clips I have set up?
ALSO.... The reason that I have the main movie clip button,
and two movie clips residing in the mcBtn is I wanted light rays to
be glowing from the text, and I was having a hard time getting what
I wanted from Flash, so I created in After Effects and exported two
.SWF files. So those .SWF files are the _over and _off states in
the mcBtn. I am having a very hard time controlling those Movie
Clips within the main MC Button. Please, any help would be greatly
appreciated.quote:
Originally posted by:
kglad
mcAboutusover should be a movieclip that has your over
animation and it should have a stop() on its last frame. it should
be placed on your _over frame in mcAbousus' timeline. you should
then use:
Ok, so I have my main timeline, in it has my
mcAboutus>> then inside that I have three labels. _up which
has the static text then on frame 5 I have the _over which has the
keyframe for the mcAboutusover, this animation is 90 frames, then I
have on frame 10, the _off for the RollOut state, and I have a 10
frame animation on that one. I still can't get it to continue on
after the initial rollover, the button still dies down.
I am going to redo everything in a presentation timeline,
based on Total Training and see if that helps my problem out any,
and will get back to you tomorrow with more info. Thanks
Maybe you are looking for
-
I get an error message 1316 when I try to install adobe 9.3, why?
I tried to install adobe reader 9.3 several times. Each time I get an error message that reads: error 1316. A network error occurred while attempting to read from the file C Documents and settings. Why? How do I fix this?
-
How to lock a folder with password ?
Please tell me how to lock a folder with password (to keep personal files)
-
How to import data from SQL server to Oracle?
Dear Sir/Madam, I want to move database data from SQL Server to Oracle, but don't how to do it, will you please help me do it?
-
ArrayIndexOutOfBoundsException when searching in ImapFolder
Hi, Occasionally, some of my test fail with an ArrayIndexOutOfBoundsException: java.lang.ArrayIndexOutOfBoundsException: message number (6) out of bounds (5) at com.sun.mail.imap.MessageCache.getMessage(MessageCache.java:132) at com.sun.mai
-
Linix/Unix Operating System ( For Oracle Database instalation)
I have much experience installing and managing Oracle Database 8.x, 9.x, 10g and 11g, Database Guards, streams, RAC and Grid on MS Advance Server 2000, MS Server 2003 ect. Now i want install Unix\Linux OS. I have required Unix/Unix OS Version and rel