No result with this code

The problem is that it won't add 100 to the score.

File: http://www.mediafire.com/?3o7qo4w1ou4j5cd

Code for 1 (Menu) frame:
Stop();
Score = 0;

Code for 2 (Level) frame:
Stop();
Score = Score;
Points.Text = "Note:"+ Score; " / / "Points" are the name of the instance of the text box of the note that is a dynamic text. 'Score' is the variable to the text box.

Code for parts:
onClipEvent (enterFrame) {}
If (this.hitTest (_root.player))
{
unloadMovie (this);
score += 100
}
}
Code for player:
onClipEvent (load) {}
speed = 5;
gravity = 0;
jumpSpeed = 5;
jumping = false;
gravityAcc = 0.3;
}
onClipEvent (enterFrame) {}
If (Key.isDown (Key.RIGHT))
{
This speed of ._x +=;
this.gotoAndStop (1);
}
If (Key.isDown (Key.LEFT))
{
This ._x-= speed;
this.gotoAndStop (2);
}
If (Key.isDown (Key.UP))
{
jumping = true;
}
If (jump)
{
This ._y = jumpSpeed;
}
gravity += gravityAcc;
This gravity of += ._y;
If (this.hitTest (_root.ground))
{
This ._y = gravity;
gravity = 0;
jumping = false;
}
If (this.hitTest (_root.coin))
{
Score += 100;
}
}

Try:

Code for 1 (Menu) frame:
Stop();
Score = 0;

Code for 2 (Level) frame:
Stop();
Score = Score;
Points.Text = "Note:"+ Score; " / / "Points" are the name of the instance of the text box of the note that is a dynamic text. 'Score' is the variable to the text box.

Code for parts:
onClipEvent (enterFrame) {}
If (this.hitTest (_root.player))
{
unloadMovie (this);
_parent. Score += 100
}
}
Code for player:
onClipEvent (load) {}
speed = 5;
gravity = 0;
jumpSpeed = 5;
jumping = false;
gravityAcc = 0.3;
}
onClipEvent (enterFrame) {}
If (Key.isDown (Key.RIGHT))
{
This speed of ._x +=;
this.gotoAndStop (1);
}
If (Key.isDown (Key.LEFT))
{
This ._x-= speed;
this.gotoAndStop (2);
}
If (Key.isDown (Key.UP))
{
jumping = true;
}
If (jump)
{
This ._y = jumpSpeed;
}
gravity += gravityAcc;
This gravity of += ._y;
If (this.hitTest (_root.ground))
{
This ._y = gravity;
gravity = 0;
jumping = false;
}
If (this.hitTest (_root.coin))
{


_parent. Score += 100;
}
}

Tags: Adobe Animate

Similar Questions

  • create the code with this code snippet

    I'm curious...

    I can't create a snippet of code with this code. (located in the first post)

    http://forums.NI.com/T5/LabVIEW/event-structure-with-value-changes/m-p/1937505#M646059

    However, I can create excerpts of its subsections.

    Tried different versions of LabVIEW with the same result.

    Can someone create a snippet?  Just curious.

    I'm not stuck or anything... just curious...  Maybe I should have posted the breakpoint...

  • Had to reformat my hard drive, now when I try to reinstall Windows XP I get a blue screen with this code at the end 0x0000007b.

    has had to reformat my hard drive now when he star0x0000007b (0x78d663c, 0xc0000034, 0x00000000, 0x00000000)

    has had to reformat my hard drive, now when I try to reinstall windows xp, I get a blue screen with this code at the end 0x0000007b (0x78d663c, 0xc0000034, 0x00000000, 0x00000000) how to solve this problem

    Hello

    I saw the 0x0000007B BSOD caused by trying to install XP on a disk hard while the BIOS is designating the reader as AHCI instead of IDE. XP has no native AHCI drivers, resulting in a stop 7B. Unless the PC had originally Vista or Win 7, but it might be useful to check that it is not likely.

    If the BIOS is set to AHCI, you could do one of three things (depending on whether your PC has a floppy drive)...

    1 find the Setup F6 disk on AHCI support at installation time (start with the manufacturer's website if you do not already have such a thing). Watch the very hit F6 prompt early in the installation process.

    2. change the setting in BIOS on IDE / ATA

    3. create a new "slipstreaming" installation disc drivers AHCI in the existing installation disc, see http://www.nliteos.com/index.html

    After the back if your BIOS is IDE / ATA

    Tricky

  • Need help with this code to update the user interface example

    I'm triying to understand the differences between the three methods to manage UI interactions.
    I'm really confused with these three terms when triying them figure out in a real case.
    Basically, I know that I should use invokeLater, invokeAndWat, or getEventLock() to avoid
    This exception: java.lang.illegalStateException: engine access UI without holding the lock on the event

    The code below illustrates the function of the invokeAndWait method, but if I replace it with
    invokeLater or getEventLock() the program will work exactly the same way.
    Could you please change the code to show the differences between the three
    methods of updating the user interface?

    / public final class HelloWorldMainScreen extends form {}

    private LabelField labelField;
    public HelloWorldMainScreen() {}
    labelField = new LabelField ("Hello World");
    Add (labelField);
    Thread MainScreenUpdaterThread = new MainScreenUpdaterThread (this);
    thread. Start();
    }

    {} public void appendLabelText (String text)
    labelField.setText(labelField.getText()+"\n"+text);
    }

    }

    SerializableAttribute public class MainScreenUpdaterThread extends Thread {}
    HelloWorldMainScreen screen;

    public MainScreenUpdaterThread (screen HelloWorldMainScreen) {}
    this.mainScreen = screen;
    }

    public void run() {}
    for (int i = 0; i)< 10;="" i++)="">
    try {}
    Thread.Sleep (5000);
    } catch (InterruptedException ex) {};
    UiApplication.getUiApplication () .invokeAndWait (new Runnable() {}
    public void run() {}
    mainScreen.appendLabelText ("Update");
    }
    });

    }
    }
    }

    These three concepts are very confusing for a lot from people so all explanatory source code
    describing their functions will be highly useful for everyone, I think.

    Thanks in advance!

    With respect to the effect, there is no difference between methods.  The difference is the way in which the result is achieved.  So we can't change the code to show you the difference.

    As we are unable to demonstrate the difference, you have to do with an explanation.  To understand the explanation, you'll need to understand the thread of events, so if you have not already, please consider this:

    http://supportforums.BlackBerry.com/T5/Java-development/what-is-the-event-thread/Ta-p/446865

    If the three options are differentiated by the processing order:

    (a) invokeLater executes the update on the thread of events.  The transformation takes place at a later stage and the code which is in order after the invokeLater will actually run before the code within the invokeLater.

    (b) invokeAndWait also manages the update on the thread of events, which means that all other events that await on the thread of events will be run before this code.  But any code after the invokeAndWait will not be executed.

    (c) the synchronized option, like invokeAndWait, runs the update of the UI before moving on to the following code.  The difference is that the code to run on the event Thread is not executed before code in the synchronized block.

    If this is meaningless, so that probably does not matter too much.  in general, you should use invokeLater, except if you need to update the user interface occur in the order with your background processing.  If so, use invokeAndWait. It has synced are very few occasions where you must use the block, and it should be very small updates to the user interface and you should understand the implications this could have on the wire events.

  • Help with this code please...

    Hi all

    I have a repeating line in a table (+ \-bouton on each line to add / remove). On each line, the user selects a value in a list drop-down down (drop-down list is filled with a literal JavaScript object if it has no chance)

    What I have to do is to check the duplicate drop-down selections on different lines and warn the user that they have selected a value twice.

    I currently have this code in the change event of the ComboBox that works very well, but for the first line only -how to twist it works for all instances of the repeated line "FullRowSubForm"?

    If (xfa.event.newText is form1. WorkforceDepSubForm.WorkforceLineSubform.FullRowSubForm.RepeatableRow.WorkforceRow1. WorkforceNameTextField.rawValue)

    {

    xfa.host.messageBox ("BEWARE you have already selected" + xfa.event.newText + "\n" + "\n" + "that one instance of dependencies should be chosen - please choose another addiction or delete.");

    }


    Thanks in advance

    Ellis

    Hello

    Your repetitive element is FullRowSubForm, don't know if that's right... it maybe too .parent is in the code to add

    In any case, it should work.

    If (form1. WorkforceDepSubForm.WorkforceLineSubform.resolveNodes ("FullRowSubForm. [RepeatableR OE. WorkforceRow1.WorkforceNameTextField ==------"" + xfa.event.newText + "\"]").length > 0) {}

    Concerning

    Bruce

  • Last month, I bought a license for Adobe Creative cloud with this code installiation [code deleted by the moderator of privacy]. Can you tell me on which account this code is activated

    Last month I bought a license for Adobe Creative Cloud with this installation code [code deleted by the moderator of privacy]. Can you tell me on which account this code is activated

    In this case, you must contact Adobe technical support.

    Click always need Help (help), and then select the Chat option:

    Contact the customer service

  • ERROR CODE 2000 - 0142 WHAT DO I DO WITH THIS CODE?

    I have a laptop DELL with Windows Vista loaded.

    It tries to load the desktop but keeps running without result green bar

    CHECKDSK is conducted without all the mistakes are found.

    DIAGNOSIS showed the color screen, then the error code 2000-0142

    which seems to be related to the hard drive.

    F2 function key works to change settings

    What should I try to run windows?

    Thank you

    Hello

    It is an error code Dell saying that your drive hard has failed and must be replaced.

    Read this information from the Dell Community.

    http://en.community.Dell.com/support-forums/laptop/f/3518/p/19451299/20115134.aspx#20115134

    http://en.community.Dell.com/support-forums/disk-drives/f/3534/p/19498610/20329964.aspx

    http://en.community.Dell.com/support-forums/laptop/f/3518/p/19485947/20274290.aspx

    For more information about error codes Dell, please ask in the Dell Community Forums.

    http://en.community.Dell.com/support-forums/default.aspx

    See you soon.

  • Everyone sees the green ball with this code in Flash Pro CC?

    If you can see the green ball up let me know what you have done. I have Windows 8 CC of PhotoShop.  I am very new when I only have the code below open in Flash saved as a ".as" when I press CTRL + ENTER, nothing happens. The problem that is when I opened another new document or 'FLA' file and when it allows me to get a glimpse of the screen after you press CTRL + ENTER there a green ball at the top of the page, but it is not in my view

    P.S. When I click on F - 9 to bring up the code, then on CTRL + ENTER it's just white with #333333 screen like the color scene size 640 X 480 and 30 Frame Rate

    package {}

    import flash.display.Sprite;

    import flash.events.Event;

    Box2D.Dynamics import. *;

    Box2D.Collision import. *;

    Box2D.Collision.Shapes import. *;

    Box2D.Common.Math import. *;

    SerializableAttribute public class Main extends Sprite {}

    private var world: b2world;

    private var worldScale:Number = 30

    public void Main() {}

    World = new b2World (new b2Vec2 (o, 9.81), true);

    var bodyDef:b2BodyDef = new b2BodyDef();

    bodyDef.position.Set(320/worldScale,30/worldScale);

    var circleShape:b2CircleSHape;

    circleShape = new b2CircleShape(25/worldScale);

    var fixtureDef:b2FixtureDef = new b2FixtureDef();

    fixtureDef.shape = circleShape;

    var theBall:b2Body is all. CreateBody (bodyDef);

    theBall.CreateFixture (fixtureDef);

    var debugDraw:b2DebugDraw = new b2DebugDraw();

    var debugSprite:Sprite = new Sprite();

    addChild (debugSprite);

    debugDraw.SetSprite (debugSprite);

    debugDraw.SetDrawScale (worldScale);

    debugDraw.SetFlags (b2DebugDraw.e_shapeBit);

    debugDraw.SetFillAlpha (0.5);

    world. SetDebugDraw (debugDraw);

    addEventListener (Event.ENTER_FRAME, updateWorld);

    }

    private void updateWorld(e:Event):void {}

    world. Step(1/30,10,10);

    world. ClearForces();

    world. DrawDebugData();

    }

    }

    }

    is principal of your document class?  (If Yes, attach a screenshot showing that.)

    you save this file Main.as, not main.as or something else?

  • HP Pavilion model 15-af131dx: Enter password administration or power on password with this Code 52199612 error

    I Home School my children and I currently have 1Laptop to use and need one that extinguished my child 4 years and now its asking me for the administration or the power on password?

    This has CREATED a huge problem my computer asks me a power on password/Admin password. I remember this password or where I would have written it down. Y at - it another way to access my system without taking in and it cost me a ton of money for someone to do something as simple as to enter a key to past simple or something? Please someone anyone help me if you can... Thank you very much

    THIS IS THE CODE IT IS GIVE me after 3 attempts failed

    52199612 *.

    Oh my god!!!
    You are my life of Eve thank you very much
    (I'm sure you know already worked)
    Thank you
    G_B_Y_

  • What's wrong with this code? Race condition?

    Guys,

    The idea behind the enclosed code is fairly simple.

    I have a 2D parent table. First of all, I print a subset of this table in an array of control (based on a selection of sensor). Now, I want to change the numbers in the table. I need changes are reflected in the table and the table parent 2D. (In simple terms, it's like replacing the subset of the table published in the parent 2D table)

    The problem is when I change any entry in the table, the entry passes to its original value. The change does not appear to be reflective on the 2D of parent table and the table. .

    Can someone tell me where is the problem?

    Thank you

    Ravi

    Thanks for the advice of Chris and ton,

    Now the code looks neat and fact exaclty what I wanted.

    See you soon

  • Help me please with this code

    Hello

    It is the first program that I tried to write alone... and I'm stuck. I am trying to acquire data from a scope. I want the vi to load only the first field of application preparation time, the code is executed. Once the installation has been loaded, I want just the vi in order to reset the scope in order to acquire more data. I tried the first call, structures of the case,... all I can think about, but when I continually run the vi, it still loops and reloads the configuration every time. I have attached a picture of the code vi and describes the area of the code in question. The case structure is programmed to initialize the scope for open communications, then erase all existing data, and then call a program of specific scope to true. Wrong, I want only this setting of the code to initialize the communication within reach yet reminiscent of the configuration. A professional can explain it please how I'm supposed to accomplish this. Thank you

    If you use RUN continuously to keep something running, you are indeed pushing the button RUN every time it stops, the function PREMI¨¨RE will return TRUE every time.

    There are ways to do exactly what you're asking, but you are better off looking at the heart of your question:

    You need a loop.

    Put a loop around the part you want to do on several occasions.

    Create a STOP button to stop the loop.

    Make your INIT orders only once outside of the loop and make sure that the INIT part something happening in the WHILE loop

    (to make sure that the loop starts after INIT).

  • Can someone tell me what's wrong with this code?

    I try to display an 'X' icon beside the offending error. If I take the test 'if' code runs. If I leave it in the symbol does not work.

    Thank you

    David

    var emailFromVal = Email.value;

    var messageVal = ' < strong > < p > < police = "helvetica" size = "5" > name: "+ Firstname.value +" < br > < br > Last Name: "+ Lastname.value +" < br > < br > Message: ' + Message.value + '< /p > ";

    We add this variable to check if someone find the address of our php file cannot send empty message by calling a php URL file

    var Permission = 1;

    If ((Firstname.value == "") {})

    move the cursor to the error to fix x, y and see the error occurred

    SYM. $("Croix") .css ("left", 10);

    SYM. $("Croix") .css ('top', 90);

    SYM.$("cross"). Show();

    }

    else {}

    Alert ("thank you, we will contact you shortly");

    .post $("sendEmail.php", {drapeau: Permission, Courriel: emailFromVal, messages: messageVal});

    }

    SYM.$("#email"). Detach();

    SYM.$("#FirstName"). Detach();

    SYM.$("#LastName"). Detach();

    SYM.$("#message"). Detach();

    Permission = 0;

    SYM. Play ("smell");

    There are two braces in the stated case

    "If ((" remove one of them.

  • Sometimes, there is no - sometimes it doesn't: help with this code?

    Just have a few questions strange inconsistency and think that someone here could double check my code. In essence, I have a button that when pressed on - adds a charger and who then disappears through the action script. The question is - usually on my first attempt to load, I see fade slightly - then stop, it is still functional, but not fully realized.

    When I close it and try again the key - this usually works well, but don't know where is my conflict. As you will see, click - I want the mc to load into the charger, then a button to be added in front of it - which is the close function of the charger. Here is my code:

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;


    btn_webLaunch.addEventListener (MouseEvent.CLICK, webLaunch);
    btnClose.addEventListener (MouseEvent.CLICK, closeWin);

    function closeWin (e:MouseEvent): void {}
    removeChild (loader);
    removeChild (btnClose);
    }

    function webLaunch (e:MouseEvent): void {}
    addChild (loader);
    Loader.Alpha = 0;
    Loader.Load (bmRequest);
    var webIn: Tween = new Tween (loader, "alpha", None.easeOut, 0, 1, 10, false);
    addChild (btnClose);
    btnClose.x = 2829.0;
    btnClose.y = 50;
    btnClose.alpha = 0;
    var closeIn:Tween = new Tween (btnClose, "alpha", None.easeOut, 0, 1, 10, false);
    }

    When you perform a local interpolation to a function, it can be gc would be before the end of the Tween.  use:

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    btn_webLaunch.addEventListener (MouseEvent.CLICK, webLaunch);
    btnClose.addEventListener (MouseEvent.CLICK, closeWin);

    function closeWin (e:MouseEvent): void {}
    removeChild (loader);
    removeChild (btnClose);
    }

    var Tween: webIn
    var closeIn:Tween

    function webLaunch (e:MouseEvent): void {}
    addChild (loader);
    Loader.Alpha = 0;
    Loader.Load (bmRequest);
    webIn = new Tween (loader, "alpha", None.easeOut, 0, 1, 10, false);
    addChild (btnClose);
    btnClose.x = 2829.0;
    btnClose.y = 50;
    btnClose.alpha = 0;
    Close = new Tween (btnClose, "alpha", None.easeOut, 0, 1, 10, false);
    }

  • Adding values to insert the query [was: Please help with this code]

    I created a comments section where there is that a single comment here field is the code for the form:

    < form id = "frmComment" name = "frmComment" method = "POST" action = "<?" PHP echo $editFormAction;? > ">"

    < h3 >

    < label for = "namegd" > < / label > comment: < / h3 >

    < p >

    < label for = 'comment2' > < / label >

    < textarea = "comment" id = "comment2' passes name ="60"lines ="10"> < / textarea >

    < /p >

    < p >

    < label for = "submit" >

    < / label >

    < input type = "submit" name = "submit" id = "submit" value = "Submit" / >

    < label for = "reset" > < / label >

    < input type = "reset" name = "reset" id = "reset" value = "Clear" / >

    < /p >

    < input type = "hidden" name = "MM_insert" value = "frmComment" / >

    < / make >

    and inclusion in the code applied to the shape is as follows

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }


    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "frmComment")) {}

    $insertSQL = sprintf ("INSERT INTO comments ('comment',) VALUES (%s)", ")

    GetSQLValueString ($_POST ['comment'], "text"));


    @mysql_select_db ($database_my_connection, $my_connection);

    $Result1 = mysql_query ($insertSQL, $my_connection) or die (mysql_error ());

    }

    But I want the form to insert more than two values to the database one commented_by and the other will be post_id where = commented_by ($_SESSION ['Username']) and post_id = $row_Recordset1 ['id'] can someone please let me know what will be the modified code and there is commented_by is a text field and post_id is an int field.
    Please guys help me thanks in advance

    It is easy to add additional values to the Insert query:

    $insertSQL = sprintf("INSERT INTO comments (`comment`, commented_by, post_id) VALUES (%s, %s, %s)",
             GetSQLValueString($_POST['comment'], "text"),
             GetSQLValueString($_SESSION['Username'], "text"),
             GetSQLValueString($row_recordset1['id'], "int"));
    

    You must ensure that code to recordset1 comes before the insertion query. By default, Dreamweaver recordset place code immediately above the declaration DOCTYPE and under other server behavior. Thus, you must move the code. Otherwise, this insert query does not work.

  • Please, help with this code

    Hello

    I use this line for dynamic create menu. I use XML and then I call the attritbutes in Flash. I want each button to call its own function. It works if I use

    = new curr_item.onRelease; News is the name of the function

    but it does not work if I use

    curr_item.onRelease = this.labelA; labelA is an attribute from XML, its value is a new

    I used the trace and the value is not indefinite.

    If you need more code, please let me know. Thanks for any help you can provide.

    this.labelA? This is probably undefined. Most likely, you will need to use:
    Switch (curr_item.labelA) {}
    case "news":
    curr_item.onRelease = News;

Maybe you are looking for

  • I have a factory to the State where it was when I bought it! How could I do

    I have dell computer and I would like to delete everything on it, except that which came with my computer when I bought it please tell me how to do a factory default thank you

  • Sony Xperia Z T-Mobile update failed

    Every time I have download and install the update, it says that the update failed. I think it has something to do with a software provided with the phone that I uninstalled. My phone is rooted. How can I solve this problem and update my phone?

  • DVD Burner problem

    I'm writing a DVD mastered with data. He is preparing to go, and then tells me "There was an error burning disc."  I then put in another disc and it never passes the validation errors entry screen. I bought another brand of DVD media and also a new D

  • HyperTerminal can not open COM16 while Device Manager displays COM16. Process Explorer can not find COM16 or the other.

    On my laptop in docking station, I used hyperterminal to display incoming data through COM16. After departure, using stand-alone laptop computer and reconnect again, COM16 cannot open Hyperterminal again. Not even when the laptop is completely stoppe

  • afeter signing key, I can't deploy ap on device

    Dear all, After I installed and sign the key in my pc and application, I can't deploy the application on the device, I have no idea what is wrong. When I deploy the ap, can she work 27% then stop and no error message, so I can't understand any proble