A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 34 of 34

Thread: [RESOLVED] Pressing movieclips in a specific order/sequence

  1. #21
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    My file was not broken, I simply did not know how you wanted it and as you say I can not do everything for you. the copy I have does those things.
    Plus things can be rearranged within the file, they don't necessarily need to be in the places that you got it.

    I only ask you to attach your fla so we can see the file in action and then point out the errors/bad bits, if you do not attach the file then we need to try and make our own version of your file which is time consuming and probably not an accurate copy.

    Shared objects, I think they have more cons than pros.

    Good luck

  2. #22
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Hehe, i agree with you. But i'm working in an idea, with the shared objects, i hope I can have success with.

    The possible solution is, to execute a .bat file from the .swf. The .bat file will navigate to where the cookie.sol is, and then it will copy it to another safe place, like my documents, C:/, an external harddrive or USB drive. That way the data saved in the shared object will be safe. Then when you need to load the data, another .bat will copy the saved cookie.sol, to its original location, where the .swf file save the shared objects cache (%userprofile%/AppData/Roaming/Macromedia/FlashPlayer/#SharedObjects/*DynamicFoldername*/mySWF/cookie.sol.

    I'm just experimenting with it, i'm not advanced in flash, so i don't know its limitations, pros and cons, and i wish to know them hehe.

    About the useHandCursor array function, i will upload the fla tomorrow, i dont know if send it in a private message to you, or make a new thread/post.

    Have a nice day
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  3. #23
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    http://www.mediafire.com/?74k1puivlpc4qql'

    Here you go! now we can create our own sequences !
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  4. #24
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I thought it was going to be the handcursor *.fla !!

    Not interested in the other file anymore, however, first time running it.

    It doesn't like it if you don't have the shared object file. it only creates one if you get the first sequence correct.

    are you not mean't to show the amount of goes you have left on the screen. not just traced.

    i get this
    Code:
    Sequence: 5,5
    You have NaN goes.
    You have undefined goes.
    You have NaN goes.
    No
    You have undefined goes.
    You have NaN goes.
    
    No
    You have NaN goes.
    You have NaN goes.
    The password area doesn't seem to work when expected.

    it's not necessary but do you ever use Auto format on your code (my altered code, lol)?

    what about the useHandCursor problem file?

  5. #25
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Ok buddy, let me let you something clear... the reason of this thread was to detect the buttons in order. We achieved it. Perfect.
    Then you suggested to take it beyond to another level, and make the sequence customizable and easily changeable , we achieved it too.
    The shared object thing , is another topic, i will work on that later (i managed to make a copy of the system's .sol file to an external driver or another location, then putting it back when needed, all this with .bat files and a flash proyector, so, the data will be always secured, and the .sol of the pc system will be destroyed/cleared after closing the flash movie/proyector. Also, the shared object thing, its for something like with the android and apple device for UnLocking the device tracing lines from a dot to another, in this case is pressing the buttons in a order, and if a person that is not the owner tries the sequence many times, then it will be locked, and only the owner with the alternative "password" methond , would be able to unlock it) So, we are done with this hehe. Yayyyyy

    **********************
    Now, with the handcursor thing, I realized the issue. The issue is, that the array function can not apply the useHandCursor=false method to a movieclip that is inside another movieclip on the stage. But if the movieclips are generated dynamically inside the movieclips creation in the array function, then it will work. So, I need a way to apply the useHandCursor method to movieclips inside movieclips placed on the stage.

    The array only work with the outter most movieclip, the main movieclip placed on the stage, not with movieclips inside of it. If I have "mc_holder" movieclip on the stage, the array works on it, but not in "mc_holder.myInnerMC". I remember something about that when attaching manuallly movieclips on the stage, they are "childs" or something, so I have to apply the script to all of it. Obviously , i can not create the movieclips dynamically this far because my game have a lot of movieclips already placed on the stage, with filters, and stuff, maybe later I can change everything dynamically, but I know there's a way to achieve this.

    PD: I don't care if you are not interested in the other file anymore, the only ones interested should be , my end users/players, and I
    I'm just kidding lol, thanks for your help, and I don't know if you opened my last .fla, you should, because I modified your script in order of creating the secuence at runtime (first frame), it saves it in the array, then you proceed to frame 2 and then the script you made load the values of the array to detect the press order.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  6. #26
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Well I did open your file and you did not achieve everything perfectly.
    I did not suggest to take it to another level, I merely stated that it might be more efficient and readily changeable using code instead of frames.

    I think putting the password in first before allowing the user to change the sequence is probably a lot smarter.

    I think you mean that clip depths are negative values when dragged on to the stage and positive values when dynamically (unless you state the depth to negative)

    The shared object, do you have to manually replace the file after you have moved it each time you start your projector?

    Can you attach your *.bat file/s so we can see how you have done it.

    If you attach your *.fla regarding the useHandCursor, we can try to help, or maybe make a test file to attach

  7. #27
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    If you will not attach your file then all I can think of is using this code,
    PHP Code:
    trace("Finding all movieClips and nested movieClips");
    trace("--------------------------------------------");

    FindClips(_root);

    function 
    FindClips(A):Void
    {
        for (var 
    i in A)
        {
            if (
    A[i] instanceof MovieClip)
            {
                
    trace(A[i] + " - MovieClip");
                
    A[i].onRollOver = function()
                {
                    
    this.useHandCursor false;
                    
    trace("You rolled over " this " with no hand cursor");
                };
                
    FindClips(A[i]);
            }
        }
    }
    trace("--------------------------------------------"); 

  8. #28
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    And the same as above but including finding Buttons,
    PHP Code:
    trace("Finding all Clips and Buttons and nested Clips and Buttons");
    trace("----------------------------------------------------------");

    FindClips(_level0);

    function 
    FindClips(A):Void
    {
        for (var 
    i in A)
        {
            if (
    A[i] instanceof MovieClip)
            {
                
    trace(A[i] + " - MovieClip");
                
    A[i].onRollOver = function()
                {
                    
    this.useHandCursor false;
                    
    trace("You rolled over clip " this " with no hand cursor");
                };
                
    FindClips(A[i]);
            }
            if (
    A[i] instanceof Button)
            {
                
    trace(A[i] + " - Button");
                
    A[i].onRollOver = function()
                {
                    
    this.useHandCursor false;
                    
    trace("You rolled over button " this " with no hand cursor");
                };
                
    FindClips(A[i]);
            }
        }
    }
    trace("----------------------------------------------------------"); 
    Good luck and have a nice day.

    Mr Nice Guy
    Last edited by fruitbeard; 09-15-2013 at 01:04 AM.

  9. #29
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Hahahahah i had an avatar of a coffee cup that read " No Mr. Nice Guy No more" lol xD

    Well, here is the .fla (finally) as you can see, the array doesn't work with movieclips inside other movieclips. I tested your loop and it works to find the moviclip instances, but it seems to disable my movieClips onPresses and replaces it with your onRollOver... i will play with it a bit to see what i can do. I tried a lot of things, using parent, root, _level0, _global, and I realized that the array to remove the handcursor only works with movieclips on the stage http://www.mediafire.com/download/59...HandCursor.fla
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  10. #30
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    And about the shared object thing:
    The flash projector runs a .bat when you press on "create backup". Then the .bat go to where the shared object is saved (C:/%userprofile%/AppData/Roaming/Macromedia/FlashPlayer/#SharedObjects/) then it reads all the folders inside and save the directory listing in a text file, then the same .bat, reads the text file, and completes the shared object's directory/url, and copy the cookie.sol, to where the proyector is being executed (external usb drive, external HD, etc. ). Then when you press on "restore backup", it make the same thing but backwards
    so your shared object data will be always safe ( I show you later )


    PD: You said I did'nt achieve anything perfectly in the Advanced button click order (with array).fla file? Well the only thing I did was, create another frame before the frame where you press the buttons to succeed, and in that first frame, you press the buttons and it saves/pushes the value in the Sequence = [] array. Is the same that writing the numbers in the array manually ( Sequence = ["1", "3", "5", etc] In other words, when movie begins you choose the order of the Sequence (the same way you would do on an iPhone, iPad, android, etc, when you First choose or create the password (joining dots with lines) to unlock your phone)

    So my app would be like this:
    1- First frame: Press buttons to create a Sequence
    2- Next button, takes you to frame 2
    3- Second Frame: The Sequence array was created on first frame, so now you can press the buttons in the correct order to succeed.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  11. #31
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Make two buttons/clips and use this, not sure if it's what you require
    PHP Code:
    stop();

    //Inicializar
    inicializar();
    removeHand();

    //Variables
    fader.gotoAndPlay(2);
    var 
    canClick false;
    cuartos 4;
    item1.itemSEL false;
    item1.activeBORDER.gotoAndStop(1);
    item1.gotoAndStop(2);

    //*chequiar porque no funciona en el
    //array
    //fin

    //Auto save
    saveState.data.cuartos cuartos;

    //Botones
    button4.onPress = function()
    {
        if (
    canClick == true)
        {
            
    gotoAndStop("nvl5");
        }
    };

    ladderMC.ladder.onPress = function()
    {
        
    this.startDrag(false,400,0,0,0);
    };
    ladderMC.ladder.onRelease ladderMC.ladder.onReleaseOutside = function ()
    {
        
    this.stopDrag();
    };

    ladderMC.ladder.onEnterFrame = function()
    {
        if (
    this.ladderBTN.hitTest(button4SPOT))
        {
            
    ladderMC.slideR._visible true;
        }
        else
        {
            
    canClick false;
            
    ladderMC.slideR._visible false;
        }
    };

    ladderMC.slideR.onEnterFrame = function()
    {
        
    ladderMC.pathMC._x ladderMC.ladder._x 30;
        if (
    canClick == true)
        {
            
    ladderMC.pathMC.gotoAndStop(15);
            
    ladderMC.pathMC._alpha 15;
        }
        else
        {
            
    ladderMC.pathMC.gotoAndStop(1);
        }

        if (
    this.hitTest(button4SPOT))
        {
            
    canClick true;
        }
    };
    ladderMC.slideR.onPress = function()
    {
        
    startDrag(thisfalse206232206, -10);
    };
    ladderMC.slideR.onRelease ladderMC.slideR.onReleaseOutside = function ()
    {
        
    this._y 232;
        
    this._x 206;
        
    this.stopDrag();
    };

    //Funciones
    function DisableHand(A):Void
    {
        for (var 
    i in A)
        {
            if (
    A[i] instanceof MovieClip)
            {
                
    trace(A[i] + " - MovieClip hand disabled");
                
    trace("------------------");
                
    A[i].useHandCursor false;
                
    DisableHand(A[i]);
            }
            if (
    A[i] instanceof Button)
            {
                
    trace(A[i] + " - Button hand disabled");
                
    trace("------------------");
                
    A[i].useHandCursor false;
                
    DisableHand(A[i]);
            }
        }
    }

    D.onPress = function()
    {
        
    DisableHand(_root);
    };
    D.onRollOver D.onRollOut = function()
    {
        
    this.useHandCursor true;
    };

    function 
    EnableHand(A):Void
    {
        for (var 
    i in A)
        {
            if (
    A[i] instanceof MovieClip)
            {
                
    trace(A[i] + " - MovieClip hand enabled");
                
    trace("------------------");
                
    A[i].useHandCursor true;
                
    EnableHand(A[i]);
            }
            if (
    A[i] instanceof Button)
            {
                
    trace(A[i] + " - Button hand enabled");
                
    trace("------------------");
                
    A[i].useHandCursor true;
                
    EnableHand(A[i]);
            }
        }
    }

    E.onPress = function()
    {
        
    EnableHand(_root);
    };
    E.onRollOver E.onRollOut = function()
    {
        
    this.useHandCursor true;
    }; 
    or call the functions however you like.

  12. #32
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Here is another sequence file for you to mess around with too
    Fla is CS6, swf is there too, just put it the same directory as the associated music files.

    http://www.megafileupload.com/en/fil...Angel-zip.html

    Mr Not Nice Guy

  13. #33
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    A 'Mr Not Nice Guy" calling "Mr Not Nice Guy" to somebodyelse, hahahahah

    Ok buddy i will mess arround with that, thank you very much, you are so strangely cool

    Please say it! Say that you have had fun with this proyect! because i did! ( I know it will be useful for you someday, while(flash.isDead==false) {} trace("lol")
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  14. #34
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    And thanks for the remove hand cursor thing too , I just added the DisableHand(_root); function call and it did the job

    Now i don't have to .push all the movieclips and buttons names in the array to remove the handcursor. You are a great programmer. When you started working with actionscript? Did you studied it, or learnt by yourself?
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center