Actionscript 2.0 scoring system - actionscript-2

I'm new to flash and I need to make a scoring system where in when you click on a symbol (button) in the stage it will add to the score textbox. I have this simple code:
on(release) {
_root.points++;
_root.score.text = _root.points;
}
that I put on the button and it works fine, the problem is when I click on another button on the stage the score textbox displays the word NAN instead of increasing by one.
Anyone can help me?

There is nothing wrong with your code... make sure you have the same code in the other buttons... perhaps you spelled a variables wrong when you were setting the .text equal to _root.points; (did you forget to pluralize it? I do that alot haha)

Related

How to delete a form from a cell in a Google Colab notebook?

I might be going crazy, but I believe I read all the existing documentation on Google Colab and I couldn't figure this one out. Maybe it's not possible, but I find this to be very weird.
I am aware that the form can be hidden, and that I can simply copy paste the contents of the cell and just paste it in a new cell that doesn't have a form, but these are hacks and not how a regular user would try to do it.
I am wondering if I'm going crazy and I just can't see the delete form button, or did someone at google colab UX simply forgot about the delete form menu? (or maybe they chose to not add it for a reason I can't understand)
You specify the form with ##param. Forms are simply interpretable Python comments.
For example
i = 0 ##param {type:'slider', max: 10}
To remove the form, just remove all ##param, including the initial ##title
i = 0
The "Add a form" menu simply inserts the ##title parameter. There is no menu to remove this line.

xaml automatic align of a textbox inside a RelativePanel

I have a TextBox inside a RelativePanel in a universal Win App in C# (XAML/vs2015).
I want the textbox to be always on the right end of the panel, even when the form size changes.
Please tell me how to do that
thank you
Well since the generic answer did the trick without needing any further detail, might as well enter it as an answer so other viewers know you got sorted and skip the question.
Since it's a child of the RelativePanel you need to supply the declaration to the element, in this case TextBox using the bool property set to true of;
RelativePanel.AlignRightWithPanel="True"
Glad you got a remedy, have a great weekend!

Capital Only Edit Control

Having a bit of a problem doing this and not sure of it can be done. I have an edit control that a user types into, I would like for the input to be all in capital letters. I tried having a custom action on the edit control to get the property, convert to capital letters and set the property again each time a letter is set but it does not work. I guessed it wouldn't but no harm in trying..:)
Has anyone else solved this? I would like to do it without having a button to press if possible. The dialog in question is a twin dialog if that helps at all.
Thanks for your help
It's not possible using the native built-in Windows Installer UI. The underlying MaskedEdit Control is primitive. There are no events to tie into to validate and modify as the characters are entered. You can only ToUpper() the property when the user clicks Back or Next.
The alternative would be to go with an external UI handler which is a lot of learning and work.

Check if a range of PictureBox's was clicked, then do the same code with different integers? Visual Basic

This is going to be rather hard to explain I expect, but I'll try the best I can.
Okay, so, I was wondering if it is possible to check if the user clicked on a specific PictureBox, and then perform an action with a few different integers? I'll give you an example.
PictureBox2.ImageLocation = "images/image.png"
However change the PictureBox2 part to the picturebox that was clicked. I'd like to know this so that I don't have to write out 100+ lines of code every time I want something like this done.
Thanks in advance!

WinForms Multiline Textbox, Enter key insists on moving focus out of textbox

I've got a multiline textbox and a button below it.
VB.NET, WinForms, .NET 2.0
System.Windows.Forms.Textbox
Multiline = True
AcceptsReturn = True
AcceptsTab = False
CausesValidation = False
No Events explicitly coded.
I'd like the Enter key to insert line-feeds and never move the focus to the next control (the button).
I'd like the Tab key to always move the focus to the next control in the tab order (the button).
What happens instead is that the Enter key inserts one line-feed and then moves focus to the next control (the button). It also does this with Ctrl-Enter, which really baffles me!
By my reading of the help files and extensive googling, it should work the way I need it to.
But obviously I'm missing something. What am I doing wrong?
A method I often use for this sort of problem is to iteratively add and subtract code until I can narrow it down to the one thing that caused the problem.
For instance, you might start by making a very simple project with just one edit box and one other control, and see what it does. If this code behaves the way you want it to, then you can start adding code bit by bit, getting the simple project closer and closer to intended final product, until the bug appears. Then look at the last bit of code you added, and see if you can subtract bits of that until the bug goes away. Iterating this a few times might help you find the culprit.
Alternatively, you could start with your existing (misbehaving) code, and start simplifying it until the bug goes away. Then you add back part of the last thing you deleted, and iterate as above.
Lastly, in this case you could also try adding an event handler for the edit control's Leave event, and put a breakpoint in the handler. When the BP hits, check the callstack and see if you can get an idea of what code precipitated the focus change. For this to work, your debugger will probably need to be configured to display code that you don't have source for (i.e. disable the Just My Code option in the debugger). You could even paste a (trimmed) callstack into the question if you want to get the group's help in deciphering it.
p.s. Does anybody have a name for the iterative debugging method described above? If not, may I propose calling it Newton's Method (or perhaps Newtoning), since it resembles Newton's Method for iteratively finding roots of mathematical functions.
It definitely shouldn't do that. The only thing I can think is it's not got enough height to accomodate multiple lines. Try adding...
textBox1.ScrollBars = ScrollBars.Vertical
If not I don't know. Try creating a blank project and creating a form with one text box, one button set the properties and see what happens...
Turns out that I had forgotten that I had done this (below) elsewhere on the same form:
'http://duncanmackenzie.net/blog/Enter-Instead-of-Tab/default.aspx
Protected Overrides Sub OnKeyUp(ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Enter Then
e.Handled = True
Me.ProcessTabKey(Not e.Shift)
Else
e.Handled = False
MyBase.OnKeyUp(e)
End If
End Sub