別のフレームでのIntを取得する:私は現在、(私の学校のために)カジノゲームに取り組んでいますが、私は問題が発生していたActionScript 3.0
var a:int //this part is in frame 1
a = 10000
money.text = ""+a //this part is working
//this part is in another frame
lost_BTN.addEventListener(MouseEvent.CLICK, lost)
function lost (e:MouseEvent)
{
cash.text = ""+a -=50 //*1 (please see below)
}
*1) Scene 1, Layer 'Layer 1', Frame 6, Line 36 1050: Cannot assign to a non-reference value.
*1) Scene 1, Layer 'Layer 1', Frame 6, Line 36 1067: Implicit coercion of a value of type String to an unrelated type Number.
*1) Scene 1, Layer 'Layer 1', Frame 6, Line 36 1067: Implicit coercion of a value of type Number to an unrelated type String.
私は情報を得るように見えるカント別のフレームで 'a'の外に出ます。
カジノゲーム?あなたは試験でサングラスを使用しなければなりませんか?:) – HRgiger
私はこの部分が間違っていると思います:cash.text = "" + a - = 50多分あなたが望むものは次のとおりです:cash.text = "" +(a -50) – SERPRO