A Flash Developer Resource Site

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

Thread: MC duplication

  1. #21
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    var clip = "jack";
    _root.mc1.mc2[jack].gotoAndPlay(2);

    when you say that, it means that MC jack is inside MC2 and MC2 is inside MC1 right?

    but i dont get the var clip = "jack";

    what does it mean on _root.mc1.mc2[jack].gotoAndPlay(2);


    oh yeah, what if a random script keeps on running?
    cause my random script is on the same frame...and my timeline runs there occasionally

    so is there any chance that it could be the one causing the problem?
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  2. #22
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    sorry, there was a typo in that

    it should be,

    Code:
    var clip = "jack";
    _root.mc1.mc2[clip].gotoAndPlay(2);
    that stores a string with the name of the movie clip (jack) in a variable named clip. it then uses this variable to target the clip jack inside mc2 (which is itself inside mc1)

    what is the code in the random script?

  3. #23
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    ohhh can you explain to me the use of the part where it uses []?
    what does var mean? can i put _root. to it?


    oh the random code? here, its placed on frame 10

    code:

    //random value between character's min attack and max attack
    damagetotal = _root.maxattack-_root.minattack;
    _root.damagevalue = Math.round(Math.random()*damagetotal+_root.minatta ck);
    //random chance if attack misses or hits
    damagerate = random(100);
    if (damagerate>=_root.misschance) {
    _root.attack = _root.damagevalue;
    } else {
    _root.attack = "Miss";
    }
    //a special attack that does times 3.5 the normal damage
    _root.SPECIALattack = Math.round(_root.damagevalue*3.5);
    _root.misschance = 0;



    there...but i dont understand why that would cause errors..but i think it does

    thx!
    Last edited by Zirclesoft; 08-05-2005 at 05:12 AM.
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  4. #24
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    oh if forgot the main values!! here they are

    _root.misschance = 10;
    _root.minattack = 100;
    _root.maxattack = 200;
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  5. #25
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    hey dudes

    umm i recently tested my flash game again....

    and i am convinced that there is something wrong with my random script

    but i just dont know what!!!

    can any1 help me? theres an example there already for a basis of my script

    thx!
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  6. #26
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    There is nothing in the code posted that could cause Flash player to need to abort the script.

  7. #27
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    so if its not in the script, then it has something to do with my variables and MCs...

    thanks ill go check it out!
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

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