ActionScript 2.0 :: Moviclip Control (if Statements)?
Oct 3, 2005
I'm building a site. When you click one of the menu items it loads the page using the 'with' command.
Example:
About button
with(_root.about){
play();
}
So when you click a button it makes the movieclip play,then when you click the button again or the close button the movieclip plays again and it dissapears.What I am looking for is when you click a different button if on of the other pages is open it closes then the new one opens so you dont get the overlapping pages.
View 5 Replies
Similar Posts:
Oct 7, 2004
If they get a question wrong in my quiz ( weakest link) the money clip goes to zero and it goes onto the next question. If they get it right the money clip advances and they go onto the next question. I want to include each time that it should only go onto the next question if all questions have been asked. SO i want an extra if clause in both sections, saying if current question is more than 11 go to '#game over"The questions are saved in the frame of the quiz
_root.qArray = new Array("question: A;B;C;D")
_root.qArray.push("Question?:A;B; C; D")
There are 11 questions.At the moment at the section with choosing answers I have
function selectAnswer(n) {
// correct
if (answers[n] == correctAnswer) {
_root.money.nextFrame();
[code].....
View 1 Replies
Nov 19, 2011
Excuse me for asking a silly question but, Why are the x and y positions of my movieclip placed in _root and _root.mc different?
View 6 Replies
Feb 23, 2005
can you help me make this work[URL]..I need that the buttons, under the tellTarget moviclip, to actually work.
View 2 Replies
Aug 11, 2009
What I'm really looking to be able to do, is have a clip in the root move to the same x and y as a clip that is embedded into another movieclip. How would I pick up the X and Y co-ordinates of this embedded movie clip?
To summarise,
ClipA is embedded into ClipB, what I want, is for ClipC - that is based in the root - to match ClipA's position.
View 2 Replies
Apr 7, 2010
I can get the movieclips into the container movieclip, but they're supposed to float around within the boundaries of container movieclip
Unfortunatly they just float off stage.
[AS]import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;[code].....
View 2 Replies
Mar 18, 2010
I have some buttons named bt1, bt2, bt3 etc
They have a common function for when each is clicked called buttonclicked.
Within the function buttonclicked, I'd like to grab the number off the end of each button name so that I can compare the number to a global variable I have called global.data.clicker
so...
if (number at end of event.target.name == global.data.clicker) {take action...
Is it possible, and if so, what code do I need to put in the first part of the if statement to make it work?
View 2 Replies
Feb 22, 2011
i want play a movieclip when i 'll click on button which is placed over another movieclip. The tree structure for this is:[code]according to this representation when i 'll click on 1st movieclip (using button which is placed over that layer ),2nd moviclip will play. and that 2nd movieclip will play once and stop.And this shoud be done whenever i'll click on 1st movieclip(i.e on button).
View 2 Replies
Nov 22, 2005
I was searching how to do something with a movieclip and all the solutions were along the lines of "place code on the MC." However, my problem is that my moviclip is dynamically imported and I am not sure How I would apply the code to my movieclip since its dynamically imported.
View 3 Replies
Jun 14, 2006
How do you make it so that wherever you click, the AS will get that location and put a specific moviclip in the spot? I've tried several things to achieve this, but i am still having problems with this.
View 1 Replies
May 2, 2008
I'm loading in external images through XML, and am trying to get the width of these images after they load, so that I can place them end to end, using the width as the spacing.
Here is what I have so far:
Code:
for(i=0; i<main.length; i++){
var loadImageListener:Object = new Object();
var imageLoader = _root.createEmptyMovieClip("loader"+i, this.getNextHighestDepth());
[Code]....
If you notice in the last line of code I'm using the number 490. I'm wanting to replace that with the width so that the pictures can be any width and they will still line up end to end.
View 4 Replies
Feb 18, 2011
i am trying to develop a small interactive game using as3.i need to play a movieclip when i 'll click on button. Anybody knows simple way for that.I'm trying this way: i have created a class for that movieclip, then i have created a object of that and then i m tring to call that object in this way.
var geese:geese01=new geese01();
trace("object created");
geese1.addEventListener(MouseEvent.CLICK, onPlayClick);
[code]....
View 1 Replies
Mar 18, 2010
I have a moviclip inside my fla library. I tried some codes but I couldn't.
View 2 Replies
Sep 27, 2011
Im fairly new in Actionscript. That being said, I'm trying to access a nested Movieclip in a MovieClip. My code looks like this
[Code]....
This is just a snippet of the hitTest. the "charBox" is the Movieclip I'm trying to access in the char Movieclip. So where did I go wrong?
View 1 Replies
Jul 19, 2010
I'm trying to resize a moviclip in the stage with a handler, but i can't find the solution for attaching the handle to the movieclip.
View 0 Replies
Feb 21, 2011
I am having (1st)one moviclip, on above that layer i have applied button to it such that as moviclip goes button will also move wit movieclip. so whenever we click on that movieclip i.e on 1st movieclip, on that click i want to play a another movieclip which is kept below that movieclip layer.
View 1 Replies
Dec 5, 2011
how can I do to resize the size of my movieClip to the stage?
View 2 Replies
Aug 9, 2010
For example I have a movieclip with two different pixels green and red. I need to remove only red pixels from that movieclip.
View 3 Replies
Sep 21, 2011
I am creating animation using as3 in which i duplicate the circle ten time,then pushing into an array and giving random motion. When all the duplicate object goes outside the stage then i should remove the event listener. But right now when one duplicate object goes off the stage the event listener is removed.
View 5 Replies
Mar 29, 2010
i already create one main movieiclip(index_mc),including menu button to link multiple movieclip, which is containt: aboutus_mc, story_mc and gallery_mc. all button in index_mc run perfectly.
In gallery_mc i've made thumbnail mc (btnthumb1_mc, btnthumb2_mc,btnthumb3) which inside already has button(btn1,btn2,btn3) to show large images in movieclip (largeimages_mc) which is large images contain several jpeg
the problem thumbnail as button cant link to show largeimages_mc, and i already put as2 in button, which is:
Code:
index_mc.gallery_mc.btnthumb1_mc.btn1. onRelease = function() {
largeimages_mc.gotoAndStop(6);
};
View 1 Replies
Jun 27, 2005
i have a movieclip named mc. it has a color of
r=255
b=0
g=0
a=70%
i have 3 buttons that when i click i need the moviclip mc to tween to a different color. so when i click button a i want it to tween to the new color:
r=255
b=255
g=0
a=70%
if i click button b it tweens from this new color to a different color:
r=51
b=102
g=204
a=70%
etc. etc.
View 2 Replies
May 5, 2010
I have the following code:
package { import flash.display.Sprite; import flash.events.MouseEvent;import lib.CustomEvents.ItemLoadCompleteEvent;import lib.Room.Item;import lib.Room.ItemStruct;
public class DragTest extends Sprite{private var itemInstance:Item;public function DragTest(){var tempItemStruct:ItemStruct = new[code].......
I have used the same code with a normal clip and it works. When I use it with my own defined item it does not work. Here are the details.
itemStruct: containing the properties of the item to be made. item : Loads the itemstruct defined item and puts it in a movieclip (item is inherited from movieclip).Traces from the above code, show that only the mouseUp function works mouseDown does not work. Though the same code works fine for a simple movieclip.I have already tried
stage.addEventListener(MouseEvent.MOUSE_DOWN,mouse Down);
EDIT: I have tried put the mouseDown on stage again if I click outside the item and drag from stage it both mouseDown and Up seem to work. But If I click on the item and drag. Still no luck. I have also added the item as movieclip on stage.
View 2 Replies
Jul 26, 2010
My application (AS3) uses Flash Player right-click zoom feature. However, when zoomed in I cannot drag when the cursor is over an image, navigation bar or active area.This makes the menu and several other pages impossible to navigate when zoomed in.The only option is for the user to zoom out and then zoom back in on the next area they want to look at.how default dragging can be enabled when cursor is over an image/ moviclip?
View 1 Replies
May 5, 2010
EDIT: If I have a class called Items and it has a movieclip instance which is loaded from a url. The startDrag on item fails. If Items contains a movieclip which we initiate from a SWC (not load it) on Drag works fine. Now how to solve the issue where I have a class which has a movieClip loaded from outside.I have the following code:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
[code].....
View 1 Replies
May 5, 2010
I have the following code:
package { import flash.display.Sprite; import flash.events.MouseEvent;
import lib.CustomEvents.ItemLoadCompleteEvent;
import lib.Room.Item;
import lib.Room.ItemStruct;
public class DragTest extends Sprite
{
[Code]....
I have used the same code with a normal clip and it works. When I use it with my own defined item it does not work. Here are the details. itemStruct: containing the properties of the item to be made. item : Loads the itemstruct defined item and puts it in a movieclip (item is inherited from movieclip) Traces from the above code, show that only the mouseUp function works mouseDown does not work. Though the same code works fine for a simple movieclip I have already tried stage.addEventListener(MouseEvent.MOUSE_DOWN,mouse Down);
EDIT: I have tried put the mouseDown on stage again if I click outside the item and drag from stage it both mouseDown and Up seem to work. But If I click on the item and drag. Still no luck. I have also added the item as movieclip on stage.
View 0 Replies
Feb 4, 2005
drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.
and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.
View 4 Replies
Mar 5, 2002
how to load different parts of a movieclip by clicking on buttons in an other moviclip?
View 2 Replies
Feb 4, 2005
do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.
and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.
View 4 Replies
Apr 9, 2010
I have a movieclip that is scrolled by means of a 'sensor' on each side of the stage. The clip scrolls fine in both directions, however here is my problem:When the users mouse leaves the stage, the movie clip stops dead in it's tracks, and this does not provide a nice smooth effect. Looking at the code below, is there any way I could tell the animation to ease out when the users mouse leaves the stage rather than simply stop suddenly?
class Sensor extends MovieClip {
public function Sensor() {
}
[code].....
View 1 Replies
Mar 2, 2009
I created a new AS3 document (550px by 400px) and added the following code to the first frame.
However, when I run this, I see nothing painted on the screen at all, the screen remains completely white.[code]...
View 3 Replies