ActionScript 2.0 :: [FMX]Controlling X Positions From One Movieclip With 4 Buttons?
Apr 26, 2004
I have a text movieclip (service_mc) on the stage for which I need to control 4 different _xpositions (_x = 0, _x = -700, _x = -1400, x = -2100) with 4 button mc's (btn_one, btn_two, btn_three, btn_four).For these four buttons I already declared the Over, Out, Release and Restore stage in a function:
Code:
for (var i in this) {
if (this[i]._name.substr(0, 4) == "btn_") {
[code].....
View 10 Replies
Similar Posts:
Apr 26, 2004
I have a text movieclip (service_mc) on the stage for which I need to control 4 different _xpositions (_x = 0, _x = -700, _x = -1400, x = -2100) with 4 button mc's (btn_one, btn_two, btn_three, btn_four).
For these four buttons I already declared the Over, Out, Release and Restore stage in a function:
Code]...
What I like to accomplish is to control the _x positions of "service_mc" with the same buttons. I mean when btn_one is pressed service_mc should go to _x = 0, when btn_two is pressed the _x position from service_mc should change to _x = -700 etc, etc
How to integrate this possibility in the existing function?
View 10 Replies
Aug 19, 2009
I'm trying to build a simple slideshow with AS3 consisting of one movie clip which should be controlled backwards and forwards using simple buttons. I can get the slideshow to play forward once but, apart from getting slide 2 to go back to slide 1, I can't get it to work with the remaining slides.
View 11 Replies
Feb 25, 2011
This is my first time coding a website using ActionScript. So far everything has went very well, I designed the website in Photoshop, and imported to Flash CS5. Then I cleaned everything up, and started adding navigation to the various pages using buttons.The website is constructed in a very simple manner, there are five main pages and they are connected by buttons on a static navigation bar (the first page, home, doesn't have a corresponding button). Then there are nine sub pages, that each contain information on a character of the game, and are connected to corresponding buttons in the 'Character' layer/MovieClip. My four menu buttons (Story, The World, Characters, Extras) all navigate correctly without problems.
The problem arises because inside my Characters page (a movie clip) are nine buttons, each linking to a different page. These buttons should bring the timeline to the frame specified, but when the buttons are clicked nothing happens. I've spent hours searching for a solution to this, but with no avail, and I have a feeling the answer is prettysimple.gotoAndStop("gowang", "Scene 1");line in the Gowang character button function with:MovieClip(root).gotoAndStop("gowang");
View 3 Replies
Nov 27, 2006
I have 6 buttons aligned horizontally. When I press one button, I want all of the buttons to move to different _X positions with easing that would be specified in an array or in a variable. I'm looking for the easiest code. I had the code and a fla. for this a few years ago when I was deep into Flash, mastering actionscript. Now, it's like starting over.
Also, can anyone assist me with a similar, more advanced code? It's the same as above, but when one presses a button, that button pressed would move to a specified _X position, and the button that was previously in that _X position would get back in line, to the far left of all the buttons...
View 5 Replies
Oct 15, 2010
A slider recognises both mouse position and also the buttons (left and right and also the buttons at the bottom) and glides/sides to the correct position area on click of the button.
View 8 Replies
Jan 22, 2007
I have thumbs placed on the stage. I create an empty mc to load swf. But my thumbs disappear from the stage when I test the movie ( html or swf) if I settle the _ and _y position of the empty mc.why the emptymovieclip positions affect the positions of my thumbnails?
View 2 Replies
Feb 19, 2008
I've just added in a bubble effect I found here. At the moment the script creates bubbles randomly across the whole width of the stage. I want the effect to only occur between two x positions, say 50 and 845, on the stage. This is the Actionscript I have at the moment.
function bubbles(){
xpos = Stage.width*(Math.random());
xpos = Math.round(xpos);
_root.attachMovie("bubble", "bubble"+xpos, 999+xpos);
_root["bubble"+xpos]._x = xpos;
_root["bubble"+xpos]._y = 299;
} interval1 = setInterval(bubbles, 50);
View 7 Replies
Feb 22, 2011
i want to have the same movieclip showing up multiple times at different locations on the screen. i don't want to create multiple instances just cuz it seems less "efficient", so it'd be neat if there's a way to do this.essentially what i'm trying to do is have a the user see the same movieclip but with different things on top of the movieclips, and if the user does something to do the movieclip in one location (ie: click to change a tile in the movieclip), i want that to take effect in all locations.i could just add event listeners to each tile in all the movieclip to have the same effect independent of which movieclip you click the tile in, but i'm hoping i can avoid this.
View 1 Replies
Jun 23, 2009
I'm adding several similar movieclips to the stage with a 'for' loop. However, I'd like to increment the position of each movieclip when added on to the stage. I know exactly where I want each movie clip positioned as well. At the moment I just have a small 'for' loop which setups the movieclip. Like so...
[Code]...
View 1 Replies
Sep 8, 2010
i want to drag a movie-clip from A to B via different positions and on stop drag , the movieclip must go back to initial position ,via the same way traversed by the mouse and with the same speed. i did an example but it's not taking exactly the same speed and i'm not using classes(you will find it attached). i have to use classes in AS 3.0.
View 3 Replies
Oct 31, 2011
I have somme mc's on the stage an I want thatto change on mc with antoher by clicking on them. For example if I click on mc1 and than on mc2 than they schould change the positions.
View 1 Replies
Jun 23, 2009
I'm adding several similar movieclips to the stage with a 'for' loop. However, I'd like to increment the position of each movieclip when added on to the stage. I know exactly where I want each movie clip positioned as well. At the moment I just have a small 'for' loop which setups the movieclip. Like so...
ActionScript Code:
for (var i:uint = 0; i<=8; i++)
{
zone[i] = new Zone();
}
I then have a long list adding and setting each mc position on the stage...
ActionScript Code:
stage.addChild(zone[0]);
zone[0].x=267.6;
[code]....
Although I've just had a thought as I was typing that last bit of code. Will I need to setup a for loop for each row...so the y position remains constant and I just increment the x value for each movie clip, and then repeat this for loop for the next row with the new y coordinate?
View 1 Replies
Jun 11, 2010
I want 3 movieclips to change positions (swap places) on the stage randomly when I push a button and make sure they are always in different positions, so they don't randomise the same way.
cat, dog, fish
position_a,position_b,position_c
position_b,position_c,position_a
position_c,position_a,position_b
then loop and randomize the position they popup in again. So I can just keep on clicking the screen and they always change.
xxxa
xxbx
cxxx
I will have the 3 movie clips on the stage with instance names.
position_a
position_b
position_c
[code]....
View 9 Replies
May 6, 2010
I have a MC with an instance name MovieClip_1 and I create another like this:[code]So basically, what I want to know is how to nest MovieClips using code, display them, and change their positions reletive to their parent MovieClip, and not the root/stage.
View 1 Replies
Oct 27, 2011
i have dynamic buttons in movieclip and i want the movieclip goto 2nd frame once some one click single movieclip while rest remains in 1st frame.the movieclips can be in arrayi have some code here:
Actionscript Code:
var mc:MovieClip = new MovieClip();for(var i:int = 0 ; i < numberOfButtons;i++){ var btn:MovieClip = new button();
[code]....
View 5 Replies
Nov 11, 2004
I am loading an external swf into an empty movie clip by use of a button.The movieclip is a sort of menu that begins with an animation of the menu opening, there are multiple different movieclips I am using with this format.What I am trying to accomplish is this.When another button is pressed, I want the movieclip (regardless of which one is loaded) to either:Go to a specific frame and play a closing animation within the movieclip, BEFORE a new movieclip is loaded. OR reverse the animation BEFORE loading new movieclip.Since there are 4 or 5 buttons all loading different clips, I need all the buttons to work this way regardless of which movieclip is loaded.
View 3 Replies
Feb 23, 2010
I am trying to control my main Scene 1 via a navigation bar within a movie clip.
I am using the following code for each button:
btn_2.addEventListener(MouseEvent.CLICK,btnClickHa ndler);
function btnClickHandler(event:MouseEvent):void{
MovieClip(root).gotoAndPlay("frametwo","Scene 1");
}
If I just put that code in for one button, that one button will work, but once I add another line of code for my next button, the only one that works is the first one, then the rest of them don't do anything.
View 4 Replies
Apr 3, 2010
i have forward/back buttons to control the timeline. what happens in the following code is that if the button is clicked while in the < or > range of frames, it gets buggy. heres the code.
[Code].....
this doesnt seem to go to the exact frame i need if i click while the current sample is still animating in. It would be much better if i could tell flash to a specific frame instead of asking flash to determine a range. that way, if a button is pressed during an animation it wont just advance one frame, it would jump to a specific frame.
I wish i could just do this:
[Code].....
i thought about creating a var that would be a string. i could then add a number to the name of that string each time the button is clicked. then i could make frame labels the name of the string. but i couldnt get my head around it. also, i didnt know how to make the button stop adding to the string name once it reach a certain value (6 in this case). or how to make it play the last sample animation if the user kept clicking the advance button at the end of the samples.
View 1 Replies
Mar 22, 2011
I'm making a section in my production with 4 audio files which are controlled with a play and stop button. I've managed to make the first one work on the page with this code -
Code:
import flash.media.SoundChannel;
var mySoundReq:URLRequest = new URLRequest("audio/track1.mp3");
var mySound:Sound = new Sound();
[Code].....
What would I need to copy to control 3 other files the same way? (i.e "audio/track2.mp3" with play_btn2/stop_btn2). I've tried copying part of the code and changing the instant names but I keep getting errors so I'd rather ask somebody who knows what they're doing.
View 3 Replies
Nov 27, 2003
I am trying to make ThumbNail Highlite via button and MC.
Each of the Thumbnails has a same button with instance named "item" 1 to 40. Also, I have the highlite MC instance named "highlite" 1 to 40 as well
I am able to triggar the "highlite" MC with the following:
=================================
onClipEvent (enterFrame) {
_root.main_nav_mov.item1.onRelease = function() {
_root.main_nav_mov.highlite1.gotoAndPlay("play_lit e");
[Code]....
View 3 Replies
Feb 6, 2009
I have created a presentation which is mostly graphics and voiceover. I have created a few custom buttons to allow the user to pause, start over, etc. (not video). In a few places I am calling to external flv files which have been placed inside movieclips. I want to be use my custom pause button to pause the flv as well, as opposed to using a flv player/controller. I have made several attempts such as:
_on (release) {
_root.myvideo_mc.pause();
}
[Code]....
and trying stop/play instead of pause, etc...all to no avail. the appropriate scripting to control an flv with a custom button?
View 5 Replies
Nov 27, 2003
I am trying to make ThumbNail Highlite via button and MC.Each of the Thumbnails has a same button with instance named "item" 1 to 40.Also, I have the highlite MC instance named "highlite" 1 to 40 as wellI am able to triggar the "highlite" MC with the following:
onClipEvent (enterFrame) {
_root.main_nav_mov.item1.onRelease = function() {
_root.main_nav_mov.highlite1.gotoAndPlay("play_lit e");
[code].....
View 3 Replies
Sep 10, 2010
Is there a way to have a button click change the main time line frame rate?
View 4 Replies
Nov 1, 2010
I have a 4 frame file that is a dvd menu. Buttons controlling navigation between all frames. There is a main page, and 3 child pages that link back to main. I have an mp3 file that I need to add as background music. I have created a new layer and added the following to the action of frame 1.
soundInstance = new Sound();soundInstance.attachSound("Music name from library"); My problem is that every time I navigate back to main from one of the child pages a new instance of the song begins so I end up with a round of music. I need the initial instance to persist throughout and not loop til the end of the song.
View 9 Replies
Feb 23, 2009
I need a button initiated cross-fade. This, for me, began as a MooTools adventure, but I've been advised by the JS developers on MooTools to pursue this with Flash. For reasons that I'm that I'm sure are obvious to you AS wise ones.I've just joined AS.org joined and have just used Awilderbeast's cross-fade AS3 snippet here:Awilderbeast's code being [my needs are explained below the code]:
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
[code].....
View 0 Replies
Nov 23, 2009
Can we control the external loaded swf with buttons created on another swf. Let me simplify this: I have one swf in which I have created one small timeline animation and the second swf has the buttons to play and stop the animation.
Now I load this 2 swf in my main file and want to control the animation through that buttons.
View 1 Replies
Sep 26, 2010
I'm updating my website and found out that I originally created it using AS1. I now need to update to AS3 and am having difficult time learning AS3 or even catching on to the basics. On two of my pages, I created a static text box, which I turned into a movie clip to have controlled by buttons. I got my down button to work, but I'm still having a problem with my up button. I can get it to work if I use the same code as my "down", but then my movie clip text continue scrolling down, instead of up. Here is my current set up:
Movie clip controller that is 3 frames:
Frame 1: stop action
Frame 2: blank
Frame 3: gotoAndPlay(2);
[Code].....
View 0 Replies
Dec 10, 2002
I have 12 different buttons that are keyboard keys that play a sound when you click on them.I am wondering if, in addition to that, one could hit, for instance, the ` key for this first one, the 1 key for the second one, the 2 key for the third one, etc..etc
View 1 Replies
May 22, 2008
I'm trying to create a movie clip that can be controlled to move a shape left or right (as animated in the movie clip) via buttons on the main stage.
I was thinking I could just add prevFrame or nextFrame to the controlling buttons when the mouse rolls over them... like this:
Code:
on (rollOver) {
this.shape.prevFrame();
}
But now I need a method of repeating it non-stop while you are on the button. Can I loop the prevFrame infinatly or loop that line of code?
P.S I'm just getting to grips with actionscript and I'm hitting a few hurdles on the way, so please excuse my ignorance.
View 4 Replies