follow-up to movieclip

Hello, im doing a FlashLite 2.1, now have after the code.

Stop();
FSCommand2 ("SetSoftKeys", "", "Quit");

Key.removeListener (myListener);

var myListener:Object = new Object ();
myListener.onKeyDown = function)
{
var keyCode = Key.getCode ();
If (keyCode is ExtendedKey.SOFT2)
{
gotoAndStop ("Quit");
}
};

Key.addListener (myListener);

Tower of Red charge
turn = "red";
buildboard();
var ball: number;

set focus on s_1 redzone_mc

// user only can access on the redzone only not blue. upward only.

If (turn == 'red')
{
Selection.setFocus (s_1);
s_7.enabled = false;
s_8.enabled = false;
s_9.enabled = false;
s_10.enabled = false;
S_11.enabled = false;
s_12.enabled = false;
}
ElseIf (turn == 'blue')
{
Selection.setFocus (s_7);
s_1.enabled = false;
s_2.enabled = false;
s_3.enabled = false;
s_4.enabled = false;
s_5.enabled = false;
s_6.enabled = false;
}

// onLoad 3 marbles of each

function buildboard)
{
_root.ballred.gotoAndStop("0b");
_root.ballblue.gotoAndStop("0b");
_root. Container.gotoAndStop ("0b");
_root.ball1.gotoAndStop("3b");
_root.ball2.gotoAndStop("3b");
_root.ball3.gotoAndStop("3b");
_root.ball4.gotoAndStop("3b");
_root.ball5.gotoAndStop("3b");
_root.ball6.gotoAndStop("3b");
_root.ball7.gotoAndStop("3b");
_root. BALL8.gotoAndStop ("3B");
_root.ball9.gotoAndStop("3b");
_root.ball10.gotoAndStop("3b");
_root.ball11.gotoAndStop("3b");
_root.ball12.gotoAndStop("3b");
}

I make a Mancala game called (Cong kak).

/ / ball1 - ball12 are all movieclips that has at least 36 marbles inside. If onLoad, I do all the movieclip stop "3B", which carries a label. now, I need to do the following sequence.

For example. inside ball1 had 3 balls, click ball1, becomes ball 0, it will go to ball2 and drop 1 ball, den go ball3 fall 1 ball, den go ball4 fall 1 ball...

did this following code:

bowl1.onPress = function()
{
selectedItem = this;
_root.ball1.gotoAndStop("0b");
_root.ball2.gotoAndStop("4b");
_root.ball3.gotoAndStop("4b");
_root.ball4.gotoAndStop("4b");
turn = "blue";
}

but I cannot do this for all 12 movieclips have source for help and did:

var bowlList: Array = [ball1, ball2, ball3, ball4, ball5, ball6, ball7,
BALL8, ball9, ball11, ball10, ball12];
function movestones (bowlIndex)
{
var numStones = [bowlIndex] bowlList ._currentframe-1;
for (; numStones > 0; numStones-)
{
place stone
}
}
s_1.onPress = function()
{
movestones (0);
}

but don't have any idea of WD to //place Pierre... someone could help me? Thank you very much!

your game will become more complicated to encode, particularly because of the way you have configured.  Anyway, I see no easy way where you are, and I see no easy way to help you without all the coding myself.

Tags: Adobe Animate

Similar Questions

  • MovieClip follow an another movieclip

    Hello

    I wanted to know how to make a movieclip to follow another movieclip as I have a movieclip mask that hides the scene except a movieclip of fish. I want to mask the movieclip to be on the movieclip to fish at all times so when the fish move, the mask moves with him and so when the fish move on something, the mask will reveal what is there.

    Thank you

    Abs55

    Don't worry, I found the answer. If anyone wants to know, is:

    {onClipEvent (enterFrame)}
    _root. Mask._x = _x;
    _root. Mask._y = FLF;
    }

    This code goes on the movieclip to fish. Replace "mask" with your own movieclip so that it works.

    Abs55

  • call for another weird problem of movieclip duplicateMovieClip

    Hello, I noticed a strange thing with duplicatemovieclip.
    Let me explain what my problem is:

    I used a movieclip called mf_instance for a menu. Inside this movieclip is a movieclip called btn2 with a text on her house.

    When I use the following inside the movieclip mf_instance code, I'll get 5 buttons under the other.
    Code:
    -------------------------------------------------------------------
    createButtons();
    function createButtons()
    {
    var of totalitems = 5;
    for (i = 0; i < totalitems; i ++)
    {
    var test: Number = ((btn2._height+3) * i) + (btn2._y + btn2._height + 10);
    duplicateMovieClip (btn2, 'button' + i, this.getNextHighestDepth ());
    This ["button" + i] ._x = btn2._x;
    This ["button" + i] ._y = test;
    This ["button" + i].btntxt.text = i;
    }
    }
    -------------------------------------------------------------------

    Now my problem:
    I have all my code in one place so I can't look where are all of the pieces of my code.
    so I call the same function and use _parent.mf_instance to access my menu.
    the problem I have is that when I trace the position there of each double button it gives me different values, but my look of buttons stacked on each other.

    code used:
    -------------------------------------------------------------------

    createButtons();
    function createButtons()
    {
    var of totalitems = 5;
    for (i = 0; i < totalitems; i ++)
    {
    var test: Number = ((_parent.mf_instance.btn2._height+3) * i) + (_parent.mf_instance.btn2._y + _parent.mf_instance.btn2._height + 10);
    duplicateMovieClip (_parent.mf_instance.btn2, "button" + i, this.getNextHighestDepth ());
    _parent.mf_instance ["Button" + i] ._x = _parent.mf_instance.btn2._x;
    _parent.mf_instance ["Button" + i] ._y = (_parent.mf_instance.btn2._height + 3) * i;
    eval(_parent.mf_instance["button"+i])._y = test;
    _parent.mf_instance ["Button" + i] .btntxt. Text = i;
    }
    }
    -------------------------------------------------------------------

    can someone help me to fix this weird?

    you're totally right, how silly of me...

    The problem is that I used this.getNextHighestDepth instead of _parent.mf_instance.getNextHighestDepth ();
    He showed the last button double because he replaced the previous ones.

    Thank you very much.. his clear, I need coffee now :-D

  • mc.addChild problem (subMc)

    Hi, I have problem of addChild to a mc.

    On my main movie calendar, I have 2 movies - mc and md, inside 'mc' is responsible for external film 'subMc '.

    in subMc, there is a button by clicking it, perform the following steps:

    • MovieClip (parent) .addChild (subMc);

    It works, however, when I do that

    • MovieClip (parent).md.addChild (subMc);

    It doesn't do a thing?  I have md on stage!

    I tried to create, delelte, change the name of 'md', the same result.

    Only thing to mention is subMc, well that is on AS3, it also has a child in her film that in AS2.

    In addition to MovieClip (parent).md.addChild (subMc);   is another way I can add subMc to md?

    Thank you.

    When you dynamically add content to an Assembly it does not occupy a specific image, unless you place it inside something which is attached firmly manually this specific image.  You would need a container in the frame 2 of the cartDrop in which you want to place cartMainMc, otherwise it is not related to a specific image within cartDrop.

  • track an object and do something when, in a distance

    How do I make a movieclip follow a nother movieclip and when it is at a distance to stop and do something?

    can you give me a code example

    Thank you

    Can you tell where you are in the world? There are a number of lists of email addresses and groups of users, you should really join. People like this kind of questions, but here on a mobile specific zone issues may be overlooked.

    But I love these kinds of questions too! So, do you remember a guy named Pythagoras? He was not familiar with ActionScript, but I think it would have been good at coding. He is the one who worked on how to tell the diagonal of a right angle triangle. It is really useful when animation of objects.

    Here's how you could have something follow another, say a script enterframe:

    MC2.x = mc2.x+(mc1.x-mc2.x)/5;

    MC2.y = mc2.y+(mc1.y-mc2.y)/5;

    Here's how to see that they are less than 20 pixels:

    var dx:Number = mc1.x - mc2.x;

    var dy:Number = mc1.y - mc2.y;

    var d: Number is Math.sqrt (dx * dx + dy * dy);.

    If (d<20)>

    Stop the mc2

    }

    It would take too long to set up an example for you, but you get the idea?

  • How to control the Captivate 4 variable using Flash Action Script 3.0?

    Hi all.

    I'm working on Captivate 4.

    According to my requirement, I need to control externally Captivate system variables in Flash using the AS3 version.

    I found a script somewhere in the forums to control system in AS1 and AS2 variables. But I need them in AS3.

    "this._parent._parent._parent.rdcmndPause = 1;  "

    "this._parent._parent._parent.rdcmndresume = 1;  "

    I tried the same way in the AS3 version but could not do.

    It is an important condition for me.

    How to control variables in Flash AS3 Cp4?

    Kind regards

    Kartik.P

    Use the following code:

    MovieClip (this.root) .rdcmndPause = 1;

    MovieClip (this.root) .rdcmndResume = 1;

    This should solve your problem

  • script being cancelled by another action

    Hello

    I am loading images 1 after the other by:

    var pathToPics = "portfolio/100_design / ';

    var preLoader: MovieClip = this;

    var externalSWFs:Array = [pathToPics + "0.swf" + pathToPics "1.swf", pathToPics + "2.swf", "3.swf" + pathToPics, pathToPics + "4.swf"];

    var loadTarget:Array = [preload0, preload1, precharge2, preload3, preload4];


    var: index number = 0;

    loadNextSWF (index);


    function loadNextSWF() {}

    If (index < externalSWFs.length) { }

    loadTarget [index] .loadMovie (externalSWFs [index]);

    preLoader.onEnterFrame = preloadF;

    } else {

    menu_prev.gotoAndPlay (1);

    menu_next.gotoAndPlay (1);

    delete preLoader.onEnterFrame;

    }

    }

    function preloadF() {}

    var bl:Number = loadTarget [index] .getBytesLoaded ();

    var bt: Number = loadTarget [index] .getBytesTotal ();

    If (bl > 0 & & bl > = bt) { }

    preLoader ["menu" + index] .gotoAndPlay (1);

    index++;

    loadNextSWF();

    }

    }

    It works very well and buttons 'menu1', 'menu2', "menu3"... become active also.

    If one of these buttons is pressed before the end of the loading sequence, the sequence ends and the images in the table stop loading.

    The button calls the following function:

    MovieClip.prototype.menuTwo = {function (d)}

    out = (pIndex=1)%pArray.length; )

    onEnterFrame = fadeOut;

    };

    What I want to achieve is:

    When you press the button 'menu2', the function 'menuTwo' is called, but continue to load the images in the table. Is this possible?

    I tried, in vain, adding the following line to the function 'menuTwo ':

    preloadF();

    Thanks again for your patience and your efforts.

    not too write this onEnterFrame loop if you want to continue loading.

  • Problem with RemoveMovieClip - code works in AS 1.0, 2.0 not

    I have a fully functional Flash created with MX2004, Action Script 1.0 patch. I am now it work with Flash 8 and compile to ActionScript 2.0.

    I have a clip created like this:

    _root.attachMovie ("DynamicLoadScreen", "loadscreen_mc", _root.getNextHighestDepth ());

    It creates a dynamic Gauge that appears on top loading clip.

    When the clip is finished loading, I throw the Gauge:

    _root.loadscreen_mc.removeMovieClip ();

    It has always worked perfectly fine with ACE 1.0 (not yet, if I change the post parameter). Now, with the 2.0, it fails. The clip doesn't go away, nothing happens, it just stays there.

    I noticed the following in the MovieClip help file reference:

    The MovieClip.getNextHighestDepth () method used in this example requires Flash Player 7 or later. If your SWF file includes a component of version 2, use the 2 version DepthManager class components rather than the MovieClip.getNextHighestDepth () method.

    Now, it is true that I added a ComboBox in this file that it had never before. Maybe that's my problem?

    If I put the publication parameters AS 1.0 and test the code removeMovieClip() works, but my drop-down list box is unavailable. If I compile for ACE 2.0, code RemoveMoveClip() on doe does NOT work, but my drop-down list box is here.

    Now you are looking for information about the DepthManager. What a PITA! Pointers appreciated...

    Thank you!

    I'll answer my own question:

    Yes, you need to use the DepthManager, if you use v2 components. It is quite simple, although not very clear documentation on how to pass from one to the other. If you used to do something like:

    someClip.attachMovie ("DynamicLoadScreen", "loadscreen_mc", someClip.getNextHighestDepth ());

    Do it now:

    Import mx.managers.DepthManager; at the beginning of your ACE
    someClip.loadscreen_mc = someClip.createChildAtDepth ("DynamicLoadScreen", DepthManager.kTop);

    Dispose it works the same way as before.

  • Referencing the MainTimeLine from an AS3 file

    I have a small question.

    I have a fla file that uses a file to build a dynamic navigation system.

    I have almost everything works such as confirmed by surveys of trace, but when I insert my stop ("image tags") in the folder, there is no effect on the app.

    I know the button works because inside of the AS file I am tracing the name of the button in the Panel out and she is correct. Also, I assigned a Switch statement for the clicked event in the file and that's okay too. It traces out correct.

    But inside the Switch statement, where the stop SIGN it does not move to the image tag. It does not move at all.

    I tried the following:

    this.gotoAndStop ("label");
    stage.gotoAndStop ("label");
    root.gotoAndStop ("label");
    this.stage.gotoAndStop ("label");

    Anyone has any ideas. Thanks for the time and effort.

    I appreciate your time. I thought about it.

    She had to actually be referenced as follows.

    MovieClip (parent) .gotoAndStop ("label");

    Thanks again for your time.

    Mike

  • Help! follow the movieclip inside ~

    How to follow the no. balls inside my movieclip (ball7)? And set as dynamic text (winner_txt)?

    P.S.: inside my movieclip doesn't have layer, layer of ball.

    No layer: each image of a person is labeled '0', '1 b' and continues...

    layer of ball: first frame empty, 2nd frame 1 ball, 3 frame 2 ball... and continues...

    Tried to use:

    var not = _root.ball7_mc._currentframe

    _root.winner_txt = Number (No.);

    use:

    _root.onEnterFrame = function)
    {
    _root. Winner = Number(_root.ball7._currentframe-1);
    Etime var = endTime - getTimer ();
    //
    If (etime<=>
    {


    delete this.onEnterFrame;
    

    _root.gotoAndPlay ("score");

    }
    on the other
    {
    time_txt. Text = Math.ceil(etime / 250) + "seconds."
    }
    }

  • Need to 'margins aside"to restrict the movement of the movieclip that follow mousee

    I like to keep the movement from left to right my movieclip that follows the mouse restricted within a 'margin' (excuse my not knowing the technical term if there is one) so it remains inside 75 pixels to the right and left side of the edge of the stage and does not go beyond.

    Here is my code:

    mouse_x = _xmouse;

    setProperty (_root.hand_mc, _x, mouse_x + ((getProperty(_root.hand_mc,_x)-mouse_x) / 2));

    Thanks to anyone who takes the time to read this. This forum is GREAT!

    in fact, the code is meaningless since your specifications are meaningless.  This movieclip is unable to be at the near left and right margins.  Did you mean you want this movieclip edges limited to not less than 75px on the scene?  that would be wise and you can use:

    this.onEnterFrame = f;

    function f() {}
    _root.hand_mc._x = (_root.hand_mc._x+_xmouse)/2;
    If (_root.hand_mc._x<75)>
    _root.hand_mc._x = 75;
    } ElseIf (_root.hand_mc._x > Stage.width - 75 - _root.hand_mc._width) {}
    _root.hand_mc._x = Stage.width - 75 - _root.hand_mc._width;
    }
    }

  • Help! I need this movieclip to follow the cursor but only in some details!

    Hello

    I'm rather new to action script and need a bit of a kick in the right direction.

    This is what I have a problem with - I used this code to the movieclip background follow the cursor:

    {onClipEvent (enterFrame)}
    x = _root._xmouse
    y = _root._ymouse
    _x +=(x-_x)/10
    FLF +=(y-_y)/10
    }

    I want however - restict movement is so it remains hidden behind the other black point with the graphic "hglf".

    I hope this makes sense and someone can help out me!

    Thank you

    You assign the instance names in the properties panel, or use the library names?

  • MovieClip follow an once hit another movieclip

    I have a movieclip called 'outside' is put on the stage, with a clip called 'internal' and other clips inside the movieclip "outside".
    An another movieclip called"object"is also on the scene. How can I make the 'object' follow 'inside' position once 'upside' hit 'object' when you press the space bar?

    Thank you very much. I already found the answer--> using .localToGlobal

  • Menu MovieClip to follow the mouse

    Hello

    I think that my previous post has lost everyone who reads it, so no answers. I will try to explain more clearly.

    If you look at this site www.douglasfisher.co.uk and click on "portfolio", then one of the images he has a mouse following menu which is works very well - how can I create that! ?

    I can handle a similar menu following good mouse, the problem I have is when the user comes out of the MC of the right or down - the MC keeps sticking as the mouse enters the MC

    Any help would be greatly appreciated.

    Mark

    If your submenu (that of the mouse tracking) called "submenu", you must assign an onRollOver and onRollOut event

    {subMenu.onRollOver = function ()}
    stop movement menu
    }

    {subMenu.onRollOut = function ()}
    follow the mouse
    }

  • Dynamically create some MovieClips

    Hi all

    Just get started with the development of the PlayBook and trying to create a simple game. I come from a c# / Java background and have no experience with ActionScript / Flash so am hit some stumbling blocks.

    I want to generate a new object on the screen from time to time (i.e. every 50 frames) so for a trial has decided to create a new object each 50 executives who begins in the center of the screen and moves all the way to the right of the screen, then jumps on the left side of the screen and so on.

    Though it may seem, that there is no threading in ActionScript model, I decided to do the following:

    [SWF (width = "1024" height = "600" backgroundColor = "#cccccc", frameRate = "30")]
    SerializableAttribute public class TestApplication extends Sprite
    {
    private var myFormat:TextFormat = null;
    private var text: TextField = null;
    private var movingText:TextField = null;
            
    private const objSpawnInterval:int = 50;
    private var timeSinceLastSpawn:int = 0;

    public void TestApplication()
    {

    myFormat = new TextFormat();
    myFormat.color = 0xAA0000;
    myFormat.size = 24;
    myFormat.italic = true;
    myFormat.align = 'center ';
                                   
    movingText = new TextField();
    movingText.text = 'X '.
    movingText.setTextFormat (myFormat);

    addEventListener (Event.ENTER_FRAME, spawnObjectIfNecessary);
    }

    private function spawnObjectfNecessary (event: Event): void
    {
    timeSinceLastSpawn ++;
    If (timeSinceLastSpawn is objSpawnInterval)
    {
    var newObj:MovieClip = new MovieClip();
                   
    newObj.x = Display.display.getDisplayWidth (0) / 2;
    newObj.y = Display.display.getDisplayHeight (0) / 2;
    newObj.addChild (movingText);
    newObj.addEventListener (Event.ENTER_FRAME, doMovement);
    addChild (newObj);
                    
    timeSinceLastSpawn = 0;
    }
    }
            
    private void doMovement(event:Event):void
    {
    var movingObject:MovieClip = event.target as MovieClip;
    movingObject.x += 1;

    If (movingObject.x > Display.display.getDisplayWidth (0))
    {
    movingObject.x = 0;
    }
    }

    }

    I thought it would make the case (yes I expect eventually to move objects in a table as at present there is no way for them should be deleted), however when I run the application it creates an "X" in the center of the screen as expected, begins to move to the right and then 50 frames later it disappears and an 'X' appears in the center of the screen.

    Please excuse the bad code above, I'm testing only

    Any ideas? Any help gratefully received

    Thank you very much

    Jim

    You have only a single instance of "movingText" then when that gets readded, it will simply reuse this instance, effectvely it remove the previous parent container.  If you have more than one text element, move, you need to create a new TextField each time when you add it to the next MovieClip.

Maybe you are looking for

  • Price of MBA 11 inch battery?

    Hello I just want to know what is the price of MBA 11 inch A1245 battery? Thank you.

  • I got this message: error. Page cannot be displayed. For more details, please contact your service provider. (9)

    When I tried to access the site stationeryheaven.com , I have a white page with this error message. Error. Page cannot be displayed. For more details, please contact your service provider. (9)It has been long since I have been on this site, but why I

  • How to pass variables between Labview and Teststand

    It is probably a trivial question, but I'm new to TestStand. All I'm doing is updated to a variable in Labview and then pass this value in a local variable Teststand. A simple test that VI is attached. I get no error and it seems correct, but when I

  • Software for the Fn keys

    I reinstalled Windows on my W530, but I can't find the software that displays notifications when I use the Fn key combination, nobody knows what software should I have to solve this problem? Thank you very much.

  • Help of Folio 13 HP

    Hello I have a laptop HP Folio 13, which has Intel HD 3000 graphics. I was wondering if there was a way to remove or replace these these graphics because they are horrible for the games. I don't know if you need more information than that, but thanks