AS3 :: Control One Movieclip From Within Another?
Jun 21, 2009
I have 2 movieclips on the main timeline of my movie; One (mc) contains an animation, the other (bt2) contains a button (bt) with code. I want it so when the button (bt) is clicked, it causes the animation (mc) on the main timeline to play.
The button's code is contained inside bt2.
So far I've tried the following things...
Code:
bt.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{bt2(root).mc.play();}
[Code].....
... along with several other things. Nothing is working at all, and I spent all last night looking for a solution with none in sight.
View 3 Replies
Similar Posts:
Oct 23, 2009
I have a button inside a movieclip, to which I would like to apply a rollover function. When rolled over, this button (inside MOVIECLIP 1) would make (MOVIECLIP 2) jump to second frame. I'm using Flash 8.This is turning onto a real headache for me, since i've searched every single forum and thread concerning this matter, and nothing seems to work.
View 7 Replies
Jan 21, 2009
Originally, the client wanted to control "hero_mc" using the keyboard but now they would like to control him with buttons only. Here is the original code on the "hero_mc" which works as expected:
[Code]...
View 2 Replies
Feb 1, 2012
I have got two movieclips on the main timeline. First one is envelope_mc and second is bg_main. In envelope_mc timeline there is a button on 25th frame which plays ahead when clicked.
stop();
on_btn.addEventListener(MouseEvent.CLICK, playAhead);
function playAhead(event:MouseEvent):void
{
play();
}
I have also got some animation on bg_main which I wan't to trigger on 30th frame (inside bg_main timeline) when button is clicked in envelope_mc timeline.
View 1 Replies
Apr 1, 2009
I've a basic portfolio page with 5 links. The idea being that 4 stay small and the active page is a larger font. When one link is clicked, itself and whatever font is currently large both swoop down and then the large text is replaced by whatever section the user chose.
I haven't keyframed anything, it's all done with actionscript and here it is. I made one of the links show what the var is currently set to in a dynamic text box. That all seems right. But whenever the 'currentchoice' mc is asked the swoop down, it just disappears rather than animates out. Here's the actionscript.
import mx.transitions.Tween;
import mx.transitions.easing.*;
var currentchoice:Object = new Object();
currentchoice.selection = large_anne;
[Code].....
View 1 Replies
May 2, 2011
I am very rusty on my actionscript but here is my issue.I am declaring a variable:var activeTab = "none";the using the varible in a function the variable is working and holding the name of the movie clip that was clicked:
function moveTabs(event:MouseEvent):void {
if (activeTab == "none"){
activeTab = event.target.name;
[code]....
View 1 Replies
Jul 7, 2009
I have 2 SWF file, Main & Sub. Main file having two Buttons that is "load" and "Change color" and a "loader_mc" movieclip. I have a movie clip under Sub Swf file named "myMovie_mc"Now what I am trying to do loading "sub.swf" to "loader_mc" movie clip by Load button of main.swf and then trying to change color of "myMovie_mc" by clicking "Change color" button of main swf file.
View 1 Replies
Jan 31, 2008
I am trying to control the speed of multiple movieClips. Each movieClip has to run a different rate of speed. What is the best way to accomplish this?
View 2 Replies
May 19, 2008
I have a nested movieclip that I need to control.I have searched the net and to this point I have been able to make it gotoAndStop at frame 1 and play().I can't make it stop.I understand that actionscript can be attached to the movieclip instance or placed on the root timeline.what I would like is direction to websites and or tutorials that might teach me how to control a nested movieclip.
View 3 Replies
Feb 3, 2009
Perfect for what I have to do, although my MX doesn't seem to like the on(change) function.
View 2 Replies
Apr 8, 2009
I'm putting together a site, that has 3 pages and I'd like the content to move into position when the menu button is clicked. So, 3 buttons etc, 'Home, Portfolio, contact" and one movie clip that contains the info. I'm not really a programmer [URL].
View 1 Replies
May 11, 2009
I've created some animated buttons (using movieclips of keyframe animation) and when the mouse goes over the button it starts a new animation sequence.now I would like to add some text when the mouse goes over the button but I tried adding the text I want to a new layer of the animation but obviously this just plays for the duration of the animation sequence or if I add another keyframe so it only shows for a short time then it will flash up each time the sequence loops around (I don't want the overstate sequence just to play once - I want it to keep going while the mouse is over the button)
View 7 Replies
Feb 5, 2010
I need to create a movie (AS2) that the user can control forward and backward by a slider. Moreover the slider should be updated automatically by the movie timeline position.
View 3 Replies
Jun 14, 2010
I was wondering if there is a way to control the volume of a movieclip directly without using the sound class?
Or is there a way to control the volume of the entire swf?
View 2 Replies
Jan 28, 2010
In Flash/ActionScript2, is it possible to capture the mousemove, buttonup and down event but only within one MovieClip? At present, i can capture mousemove etc. via a listener, but only for the entire stage..I need to draw a rectangle for selecten, and then press a save button. The problem is i save the coordinates on mousedown and up, but when I press on the save button, it saves the coordinates of when you pressed on the save button...I've tried mc.onXY, but that either listened not at all or to the entire stage...
Edit: Code as requested
mc.onMouseDown
should be
mcImageToCrop.onMouseDown
I did change it back to mc when mcImageToCrop didn't work...
import flash.geom.Rectangle;
Create a container by calling the setUpContainer functie wich will return a movieclip with a needed propeties set.
var container:MovieClip = setUpContainer();[code].................
View 1 Replies
Dec 24, 2011
I want to control movieclip "A" components from movieclip "B".[code]...
View 1 Replies
Feb 12, 2009
I'm trying to control the information that will be shown in the textBox that is located in one of the frames of the movieClip but it seems that in actionScript 3.0 the code has changed. does anyone know what is the new code for doing it? My aim is that if I define a "var" on the stage and get a certain letter in that var then that letter will be shown in the movieClip in the key Frame that the textbox was set
View 1 Replies
Feb 2, 2010
I am trying to control a MovieClip around a scene. I know I can do this using the well known:
Code:
function onEnterFrame()
{
if( Key.isDown(Key.RIGHT) )
[Code]....
It appears that the function downListener is unable to see the class scoped variable xvel though I do not iunderstand why.
View 0 Replies
Aug 14, 2010
I'm doing a simple game. When two objects collide, a function is activated with a movie clip of an animated explosion. I wonder how to do to control this animation so it's played two times? Just a simple for loop?Then another thing, how to create a short delay so that the code don't jump away direct without showing the explosion when there is code like gotoAndStop in the end of the function? Perhaps I also whant a tweeing rotation of the explosion movie clip before leaving the function? In some way it seem like it would be necessary with some delay?
View 0 Replies
Jul 13, 2011
i have lots of movieclips in different frames and i must control them to go frame 2. i can't use
Code:
movieclipname.gotoAndStop(2);
because they don't have instance name and there are over 1000 movieclips.what would be best way to do that
View 1 Replies
Feb 11, 2004
I have a moive clip on _root and another movieclip within several other movieclips. I want the moiveclilp that is in several other movieclips to be able to stop the movieclip on _root on a release trigger.
I basically just want to know the proper AS for using one movieclip as a button that stops or plays another movieclip.
View 2 Replies
Oct 23, 2004
here is the AS i am having trouble with
[AS]
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.this.nextFrame();
[code]....
I want to make it so when i roll over my movie clip (that i attach this AS to), a different movieclip is controlled. This AS
[AS]
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
[code]....
Works great, when using 'this' for the prev and next frame control but i cant figuire out how to control a different movieclip on root.
View 1 Replies
Sep 14, 2005
I can't find a way to control object overlaping. In example: Object1 colided with Object2 -> If Objext1y > Object2y then Object2 should go to back, I mean Object1 has to overlap it. Is there a special action for control of object to be showed in front of other object?
View 2 Replies
Apr 11, 2003
Does anyone know how to control the brightness of a movieclip through action script. I can't seem to find the syntax for that property (if there is such a thing).
View 1 Replies
Dec 27, 2005
using AS2.0 and flash 8.(I have probably misunderstood AS commands stop() and gotoAndStop())
ok setup got 4 layers: Action, tween1, tween2, tween3.
tween1 one has 1 frame with a movieclip (mc1)
tween2/3 has 1 frame with mc2/3.
the movieclips(symbols) are named mc1, mc2, mc3. first frame in
respectively clip is called mc1, mc2, mc3.
[Code]...
View 1 Replies
Jul 19, 2006
I've got an fla with over two thousand movieclips in one frame. Each movieclip does not have an instance name. way to control each movieclip individually? For example, rotating all movieclips 45 degrees?
View 4 Replies
Feb 1, 2007
I'm pretty sure this is doable, but I'm not entirely sure how to set it up. Basically, I would like a specific movieclip to play when I am online and another to play when I am offline (kind of like a "hello, I'm viewing this site and am online" type thing, so others know I am at my computer).
View 1 Replies
May 27, 2009
OK, so im trying to make a seemingly simple as3 project where I instantiate a movieclip from the library, and then move it using keyboard controls. I got it working fine using ye olde as2 method (all the code on the timeline of the .fla), but i cant get it to work using the as3 .as file method (if that's the right description).
[Code]...
View 4 Replies
May 13, 2002
what i'm trying to accomplish is onthe rollover of a button, a picturefades in, and on rollout, the picturefades out. that shouldn't be too hard,but i would like to have one rolled out and another rolled over, so one pictureis fading out, and another fading inthese pictures are supposed to overlayso i am thinking that i will need to useactionscripts to control the timeline ofa movieclip.
View 1 Replies
Feb 11, 2004
I am probably just making a stupid mistake but can someone show me how to do the following... I have a moive clip on _root and another movieclip within several other movieclips. I want the moiveclilp that is in several other movieclips to be able to stop the movieclip on _root on a release trigger. I basically just want to know the proper AS for using one movieclip as a button that stops or plays another movieclip.
View 2 Replies