Moving movie clips with ActionScript
I am trying to move four movie clips with actionscript in a
circler motion with two buttons, one to rotate the mc’s to
the left and one button to rotate the mc’s to the right. Here
is a link to what I am trying to do;
http://www.us.playstation.com/Lair/
and it is undrer game features.
Yes, that's what the code I gave you is intended to do....
you replace that code with whatever action you need to take to turn
your movie around.
I have no idea what your movieclip is doing, but I'm guessing
by your response that if it was an arrow pointing left to right
(just an example), you want it to be pointing right to left when
the left arrow is pressed. If you want an immediate turn around,
then the simplest way to do that is to have another frame
containing the movieclip that it moves to where it faces the other
direction--and to have it appear turned around, from the toolbar
you select Modify -> Transform -> Flip Horizontal.
So the movieclip would live inside another movieclip that has
two frames with stop()'s for each frame. In the first frame you
would have the subclip facing left to right, and in the second you
would have it facing right to left. If we call that 2-framed
movieclip "walker", the code I provided before would
become...
Similar Messages
-
Moving Movie Clips with Arrow keys
How do i make it so when i click the left arrow key, it will
change the movie clip to make it turn around?Yes, that's what the code I gave you is intended to do....
you replace that code with whatever action you need to take to turn
your movie around.
I have no idea what your movieclip is doing, but I'm guessing
by your response that if it was an arrow pointing left to right
(just an example), you want it to be pointing right to left when
the left arrow is pressed. If you want an immediate turn around,
then the simplest way to do that is to have another frame
containing the movieclip that it moves to where it faces the other
direction--and to have it appear turned around, from the toolbar
you select Modify -> Transform -> Flip Horizontal.
So the movieclip would live inside another movieclip that has
two frames with stop()'s for each frame. In the first frame you
would have the subclip facing left to right, and in the second you
would have it facing right to left. If we call that 2-framed
movieclip "walker", the code I provided before would
become... -
Controlling Movie Clip with actionscript Question
Dear All,
I have a movie clip named A which inside this movie clip
there is another Movie clip named B and inside B there is a listbox
component.
Inside Movie clip A there are 20 frames which at frame 10
there is a stop() script.
My question is how to control Movieclip A to run
gotoAndPlay(11) from MovieClip B when there is a click action to
the listbox?
Please Advise,
Ozheeif A is on the _root timeline from anywhere in your _level0
swf you can use: -
Casting a 3d movie clip in actionscript
Hello All,
I'm new to flash and actionscripting (i come from the land of ansi c but have traveled extensively). I've created a great animated animated 3d movie clip and want to have them generated on the stage in relation to an xml file. I've gotten this to work with a 2d movie clip but am running into problems casting a 3d object.
my object (a movie clip - boxContainer with an instance name of boxContainer_mc) is built out of all movie clips in the following way (shown in tree form):
boxContainer
-bottomBox
---boxFront
---boxLeft
---boxRight
---boxTop
---shadowFront
---shadowLeft
---shadowRight
---gradientLeft
---gradientRight
---gradientFront
-topBox (this movie clip contains an animation that is controlled through a MouseEvent:Click)
---left
---right
---top
---back
This animates smoothly through flash, but doesn't work when I try to cast the movie clip in actionscript 3 using the following code:
var boxContainer_mc:boxContainer = new boxContainer();
addChild(boxContainer_mc);
When I try to test the swf file I recieve the following errors:
1046: Type was not found or was not a compile-time constant:boxContainer
1180: Call to a possibly undefined method boxContainer
any ideas?If this is a library item that you named boxContainer in the library, you need to designate that name as the linkage ID for the movie. Right click on it in the library, select Linkage from the menu that appears, and in the interface that appears select the Export for Actionscript option (another will be slected automatically). Be sure your Class name appears as you have it coded and click ok.
-
what type of movie clips are handled by the ipad? I have shot a movie clip with my canon camera and the file is .AVI. will this load onto ipad?
Per http://www.apple.com/ipad/specs/
AirPlay Mirroring to Apple TV (2nd and 3rd generation) at 720p
AirPlay video streaming to Apple TV (3rd generation) at up to 1080p and Apple TV (2nd generation) at up to 720p
Video mirroring and video out support: Up to 1080p with Apple Digital AV Adapter or Apple VGA Adapter (adapters sold separately)
Video out support at 576i and 480i with Apple Composite AV Cable (cable sold separately)
Video formats supported: H.264 video up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format -
Hi, I am trying to copy a movie clip with an flv in it from
one project to another. Everything works fine except the flv just
keeps trying to load and never plays. I am not sure what to do. Any
suggestions?It sounds like you are using the FLVPlayback component to
display the FLV, in which case, the FLV is a separate file and
likely needs to be in the folder next to the new project. Go back
to the old project and copy the FLV from its location there to the
new projects folder. -
Noob help: Triggering Movie Clips with Buttons
Hi guys,
I'm taking an intro Flash and Action Script class and for my final I need to create a portfolio project that contains 5 unique buttons that trigger 5 unique movie clips. I'm having a hard time with this. I've been able to trigger the 1st movie clip with the first button (although I can't stop it) but I can't trigger any ohter movies with any other buttons.
Here's my code:
stop();
chuck1_btn.addEventListener(MouseEvent.CLICK, playMovie);
function playMovie(event:MouseEvent):void
spaceship_mc.play();
chuck2_btn.addEventListener(MouseEvent.CLICK,playSaucers);
function playSaucers(event:MouseEvent):void
saucers_mc.play();
Nothing happens when I click on chuck2_btn when I test the movie. I think I need to create a variable or class but I'm not sure. I'm a super noob with this stuff. Any thoughts? Thanks!
RickYou should learn how to use the Help documentation to find answers like how to use the visible property. For the code you showed earlier, here's what you can try in frame 1 to replace it.
stop();
spaceship_mc.visible = false;
saucers_mc.visible = false;
slideshow_mc.visible = false;
chuck1_btn.addEventListener(MouseEvent.CLICK, playMovie);
function playMovie(event:MouseEvent):void
spaceship_mc.visible = true;
saucers_mc.visible = false;
slideshow_mc.visible = false;
spaceship_mc.play();
chuck2_btn.addEventListener(MouseEvent.CLICK,playSaucers);
function playSaucers(event:MouseEvent):void
spaceship_mc.visible = false;
saucers_mc.visible = true;
slideshow_mc.visible = false;
saucers_mc.play();
etc...
It could be refined, like having a function that hides everything and using that every time before making the one you need to show visible. You might find it necessary to include telling the movies to gotoAndStop(1) as well.
That's about as generous as I'm going to get. It's important that you learn things, and handing you a solution isn't going to help do that. -
Check for movie clips with AS?
Is it possible to check if a frame contain a movie clip with
AS, and then if movie clip is found run a function? Like a global
"event handler " for movie clips.I want a function that automaticly can detect and fade in any
movie clip found in any keyframe in the main timeline. So i don't
have to make
In the first keyframe in the main timeline
on (ohh here i found a movie clip)
//let's run a nice fade function on that movie clip
mx.transitions.TransitionManager.start
(eval(TheClip),
{type:mx.transitions.Fade,
direction:0,
duration:1,
easing:mx.transitions.easing.None.easeNone,
param1:empty,
param2:empty
Something like that -
Buttons, movie clips and actionScripts
I've created myself conundrum. In my test movie I have
created two named frames on the screens timeline (home, box); each
content frame consists of a movie clip with a button in it
(home_btn, box_btn). What I'm attempting to do is have the home_btn
button call the movie in "box" and have the box_btn button call the
movie in "home".
If I don't use movie clips the is a simple task,
home_btn.onRelease = function() {
gotoAndPlay("box"); }
but as soon as I place the buttons inside a movie clip the
navigation ceases to work. I'm assuming I'm getting beaten as
something very basic, but unfortunately I can't find it.
Anything thoughts would be greatly appreciated. Thanks
locoLindyPerfect! That fixed the problem. Many thanks for your help,
I'd have toiled with that for days!
Again, that's for your help!
locoLindy -
Exporting a move clip with alpha channel
Hi there,
I’m trying to export a move clips with alpha channel.
I’m trying to export an animation with Premiere CS5. I made an animation of a rotating object in Maya and exported it with alpha channel as tiff images. Then they are edited with Photoshop to give them a drop shadow.
My problem is this. Can I export this tiff animation with the alpha channel?
My plane is to use move clips over backgrounds in a game – depending on the result there are different animations playing on top of several different backgrounds. There for the objects has to have a transparent/alpha channel over the backgrounds.
Again the reason for this is the complexity of the game and to make the game looking as real as possible. I’m hoping for some help here to make my plan possible
…thanksThanks alot for the help.
But now I’m wondering how to get the file size down?
The 32bit and alpha channel just increase the file size from about 1MB to 9,3MB, which is pretty much??
…any ides mate? -
How do I move a movie clip in actionscript 3.0?
Let me start off by thanking Everyone who have help me on Adobe Forums! it helps a ton i am new to actionscript and am trying my hardest to learn it so thank you i cant tell you how it means!
I have a movie clip of an acorn named "games" and inside this i have another movie clip named "em_games" when it is click i want to to play out an animation just changing the y coordinates from where the acorn sits in the tree and fall to the ground also when it hit the ground i want it to fire off an animation it has nested inside of it where it cracks open and a piece of paper fly upward where it rests at the top of the screen.i have not moved many objects through actionscript 3.0.
thanks again to everyone who has helped me out!One way to move an object using AS3 is to use the built-in Tween class. You should look it up in the help documentation for details, or search Google for a tutorial.
There are also third party tweening clsses such as TweenLite and Tweener that you could use, though if you are just beginning that might be a lesson better left to more experience since it involves downloading/installing the classes.
You could also just use an ENTER_FRAME approach to have the y property of the movieclip continually change until it reaches its final value. -
Moving a clip with a custom scrollbar
This is a newbie question.
I've devised a custom scrollbar in this
test site (in section
Ego). The scrollbar is a movie symbol containing another symbol,
the scroll button. The scrollbar has code for moving the scroll
button and it works.
Now, on the left, you see a long text that I want to scroll
with the scroll button. Pretty simple.
The text is a movie clip containing several textfields.
So... how to synchronize both? Probably with a listener that
will modify the _y position of the movie clip according to a
movement ratio. I'm a little bit confused.
The text movieclip is called: 'contenu_mc'
The scroll bottom is called: 'goupillon_mc' (but is inside
'defilement_mc', the whole scrollbar)As long as it has room in the timeline to move it, do the following:
1. Select the clip
2. Press +5. (period) and then enter.
You clip will then move 5 seconds forward in the timeline.
Hope that helps you. -
Moving an image with actionscript
I'm trying to move an image from position Y:0 to Y:-100 using
actionscript when the .swf file loads, as this is smoother than
conventional tweening??Well Sim-Enzo is almost correct. You will have some problems
though because it is not really complete.
When you want to do things over time (move, fade, scale,
etc.) with actionscript you have two main choices –
onEnterFrame and setInterval. For the example given by Sim-Enzo I
would rewrite it like this:
myImageClip.onEnterFrlame=function(){
if(this._y>-100){
this._y-=10;
}else{
delete this.onEnterFrame;
this._y=-100
Here are why I would make these changes.
First the onEnterFrame is poorly named and confuses a lot of
folks. So remember onEnterFrame means "do this next bit of code at
the frame rate of the movie – even if the timeline is stopped
or there is only one frame."
Next. Each movie clip instance can only have one onEnterFrame
handler defined for it. So it is a good idea to assign each one to
an appropriate clip to avoid problems. By attaching this one to the
clip you want to move, myImageClip, you will also be able to assign
other ones to other clips and do whatever they need to do.
Then inside the event handler, notice how I refer to the clip
by "this" since the onEnterFrame is scoped to the myImageClip.
Finally, and this is probably most important, I have added an
else to the conditional. This makes sure that once your clip has
move to where it is supposed to go that the onEnterFrame is
stopped. Otherwise the onEnterFrame would just keep going –
it wouldn't move the clip anymore, but it would be using up
processor time. One errant onEnterFrame like this wouldn't probably
bring down your swf, but if you didn't do it with many different
ones you would notice.
I also added a little bit there which put the clip exactly at
the place I wanted. There are times in Flash where rounding errors
or other issues can make for surprises. I think it is good practice
to set the value to the exact required value. -
Play multiple movie clips - with sound
Hello Forum members,
I am a total new comer in terms of flash and action script,
self-educated and Adobe forum and internet educated. I can now
click a button and stop and start a movie clip, use attachMovie,
and even mute sound in a movie clip (not video). I am currently
using Flash 8, and waiting for CS3 (downloaded a trial, and like it
better than Flash 8).
Enough history - now to my question - I have an application
that had 3 scenes. I read in some Adobe article
"Flash Best Practices" that it was not a good idea to use
scenes in an application. I converted my Scene 2 and Scene 3 into
movie clips.
I figured I could either put each movie clip on a separate
layer in my timeline (mc_scene2, mc_scene3)
and play them, one after the other (did not quite work, more
later). Or...
copy the timelines from the scenes, and add those frames to
my Scene 1, making a application with both scenes staggered one
after the other in the main timeline. Or...
Keep Scene 1 and at the end of scene 1,
attacheMovie("mc_scene2", etc) and when scene 2 was done play and
or attach the final movie clip (mc_scene3).
I could not figure out how to tell when mc_scene2 was done
using the attacheMovie method, so I could then attach mc_scene3,
etc.
How would I be able to tell when one attached or loaded movie
clip is finished, and then start the next one?
Or what is the suggested way to use actionscript to load a
movie, play it, and when the clip is done, load and play the next,
etc.
Thanks for a good forum,
eholz1Hello Again - I guess there is much that I do not understand.
I followed the tip above - or so I thought.
I have "buttons" on my movie clips that play the clip when
clicked.
I have placed stop actions in frame 1 of each movie clip.
I tried placing mc_scene2 and mc_scene3 on their own layer
in the timeline,
and put the code above in my actions layer (Scene 1).
it seems that nothing really works - the _visible property
seems not to work,
etc - I must be doing something wrong. What layer should the
two mc's be
placed?
Thanks for the info
Eholz1 -
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
Maybe you are looking for
-
Safari 4 breaks Automator apps
MBPro 10.5.7 Safari 4.0.2 Automator 2.0.3 Simple case: Apple's own "Tab Left", "Tab Right" speakable commands no longer work. They worked fine with Safari 3.x.x These files are located in ~/Library/Speech/Speakable Items/Application Speakable Items/S
-
Hi experts, i use LDB PSJ in my report and i would to ask what is the connection between table coss1(cosp1, cosb1) and prps_r? One more question: if i write get proj. get prps_r. get coss1. does it mean that i automatically get any records from table
-
What is the URL that Adobe Acrobat needs to contact for Activation after you enter the serial number
What is the URL that Adobe Acrobat needs to contact for Activation after you enter the serial number? We need to allow internet access to our users for it.
-
How-to prioritize BPEL processes in BPEL PM 10.1.3.4
Hi there, I would like to control the priority of my BPEL processes (in 10.1.3.4). In the documentation I read that this can be done via the embedded java method setPriority(). However, I am not sure if I should call the method from the appropriate B
-
How can I open raw files in elements 12 from nikon d810
How can I use PS Elements (Mac) to open raw files from Nikon D810?