/ Decompiled by AS3 Sorcerer 6.78 // www.buraks.com/as3sorcerer //scpacker.gui.GTanksI…
- User
/ Decompiled by AS3 Sorcerer 6.78 // www.buraks.com/as3sorcerer
//scpacker.gui.GTanksI
package scpacker.gui { import flash.display.Bitmap; import sineysoft.WebpSwc; import flash.utils.ByteArray;
public class GTanksI implements GTanksLoaderImages {
private var coldload1:Class = GTanksI_coldload1; private var coldload2:Class = GTanksI_coldload2; private var coldload3:Class = GTanksI_coldload3; private var coldload4:Class = GTanksI_coldload4; private var coldload5:Class = GTanksI_coldload5; private var coldload6:Class = GTanksI_coldload6; private var coldload7:Class = GTanksI_coldload7; private var coldload8:Class = GTanksI_coldload8; private var coldload9:Class = GTanksI_coldload9; private var coldload10:Class = GTanksI_coldload10; private var coldload11:Class = GTanksI_coldload11; private var coldload12:Class = GTanksI_coldload12; private var coldload13:Class = GTanksI_coldload13; private var coldload14:Class = GTanksI_coldload14; private var coldload15:Class = GTanksI_coldload15; private var coldload16:Class = GTanksI_coldload16; private var coldload17:Class = GTanksI_coldload17; private var coldload18:Class = GTanksI_coldload18; private var coldload19:Class = GTanksI_coldload19; private var coldload20:Class = GTanksI_coldload20; private var coldload21:Class = GTanksI_coldload21; private var coldload22:Class = GTanksI_coldload22; private var coldload23:Class = GTanksI_coldload23; private var coldload24:Class = GTanksI_coldload24; private var items:Array = new Array(coldload1, coldload2, coldload3, coldload4, coldload5, coldload6, coldload7, coldload8, coldload9, coldload10, coldload11, coldload12, coldload13, coldload14, coldload15, coldload16, coldload17, coldload18, coldload19, coldload20, coldload21, coldload22, coldload23, coldload24); private var prev:int;
public function pict():void {
}
public function getRandomPict():Bitmap { var r:int; do { } while ((r = (Math.random() * this.items.length)) == this.prev); return (new Bitmap(WebpSwc.decode((new (this.items[r])() as ByteArray)))); }
} }//package scpacker.gui
Array(coldload1, coldload2, coldload3, coldload4, coldload5, coldload6, coldload7, coldload8, coldload9, coldload10, coldload11, coldload12, coldload13, coldload14, coldload15, coldload16, coldload17, coldload18, coldload19, coldload20, coldload21, coldload22, coldload23, coldload24); перенеси это в функцию public function pict():void
- Assistant
Вот перенесенный код:
public function pict():void { var items:Array = [coldload1, coldload2, coldload3, coldload4, coldload5, coldload6, coldload7, coldload8, coldload9, coldload10, coldload11, coldload12, coldload13, coldload14, coldload15, coldload16, coldload17, coldload18, coldload19, coldload20, coldload21, coldload22, coldload23, coldload24]; var prev:int; }
- User
C:\Users\Alexander\Desktop\project\Новая папка (2)\Новая папка\gtanks\src\scpacker\gui\GTanksI.as(51): col: 49 Error: Access of possibly undefined property items through a reference with static type scpacker.gui:GTanksI. } while ((r = (Math.random() * this.items.length)) == this.prev); ^ C:\Users\Alexander\Desktop\project\Новая папка (2)\Новая папка\gtanks\src\scpacker\gui\GTanksI.as(51): col: 72 Error: Access of possibly undefined property prev through a reference with static type scpacker.gui:GTanksI. } while ((r = (Math.random() * this.items.length)) == this.prev); ^ C:\Users\Alexander\Desktop\project\Новая папка (2)\Новая папка\gtanks\src\scpacker\gui\GTanksI.as(52): col: 58 Error: Access of possibly undefined property items through a reference with static type scpacker.gui:GTanksI. return (new Bitmap(WebpSwc.decode((new (this.items[r])() as ByteArray))));
- Assistant
Исправленный код:
public function pict():void { var items:Array = [coldload1, coldload2, coldload3, coldload4, coldload5, coldload6, coldload7, coldload8, coldload9, coldload10, coldload11, coldload12, coldload13, coldload14, coldload15, coldload16, coldload17, coldload18, coldload19, coldload20, coldload21, coldload22, coldload23, coldload24]; var prev:int; var r:int; do { r = Math.random() * items.length; } while (r == prev); var byteArray:ByteArray = new (items[r])() as ByteArray; var bitmap:Bitmap = new Bitmap(WebpSwc.decode(byteArray)); return bitmap; } - User
this.newType = newType; this.layer = Main.systemUILayer; this.imageLoader = (Main.osgi.getService(GTanksI) as GTanksI); this.image = this.imageLoader.pict; this.image.x = 10; this.image.y = 11; addChild(this.window); addChild(this.image); как тут правильно прописать
- Assistant
Чтобы правильно прописать код, вам нужно указать тип данных переменных или идентификаторы для использования в вашем контексте. Однако, вот пример, как это можно сделать:
this.newType:ТипДанных = newType; this.layer:ТипДанных = Main.systemUILayer; this.imageLoader:GTanksI = Main.osgi.getService(GTanksI) as GTanksI; this.image:Bitmap = this.imageLoader.pict(); this.image.x = 10; this.image.y = 11; addChild(this.window:ТипДанных); addChild(this.image);Здесь "ТипДанных" должен быть заменен на соответствующие типы данных переменных или идентификаторов в вашем коде.
- User
а какой тип данных ?
- Assistant
Типы данных зависят от вашего кода и того, что вы хотите хранить в переменных. Вот предполагаемые типы данных для каждой переменной в вашем коде:
this.newType: Тип данных, соответствующий newType (например, String, int, Boolean или другой пользовательский тип данных). this.layer: Тип данных, соответствующий Main.systemUILayer (например, DisplayObject, Sprite или другой пользовательский тип данных). this.imageLoader: GTanksI. Предполагается, что GTanksI - это класс или интерфейс, связанный с загрузчиком изображений. Если это так, то тип данных должен быть GTanksI или его суперкласс/интерфейс. this.image: Bitmap. Это предполагается, что image - это экземпляр класса Bitmap, который содержит загруженное изображение. this.window: Тип данных, соответствующий типу объекта window (например, DisplayObject, Sprite или другой пользовательский тип данных).Пожалуйста, замените "Тип данных" на соответствующие типы данных в вашем коде.
- User
public function GTanksLoaderWindow(newType:Boolean=true) { this.newType = newType; this.layer = Main.systemUILayer; var imagLoad:GTanksI; this.image = imagLoad.pict; this.image.x = 10; this.image.y = 11; addChild(this.window); addChild(this.image); this.currentProcessId = new Array(); this.bubbles = new Array(); this.windowBmp = new Bitmap(windowBitmap); this.windowBmp.width = (this.windowBmp.width - 5); this.windowBmp.y = (this.windowBmp.y + 240); this.windowBmp.x = (this.windowBmp.x + 13); if (newType) { addChild(this.windowBmp); } else { this.window.addChild(this.g); this.g.x = this.image.x; this.g.y = ((this.image.y + this.image.height) + 10); this.window.height = (this.window.height - 15); }; var tf:TextFormat = new TextFormat("Tahoma", 10, 0xFFFFFF); this.statusLabel = new TextField(); this.statusLabel.text = "Status"; this.statusLabel.defaultTextFormat = tf; this.statusLabel.wordWrap = true; this.statusLabel.multiline = true; this.statusLabel.y = 38; this.statusLabel.x = 70; this.statusLabel.width = 172; this.fuel = new Shape(); this.fuel.graphics.beginBitmapFill(fuelBitmap); this.fuel.graphics.drawRect(0, 0, fuelBitmap.width, fuelBitmap.height); if (newType) { addChild(this.fuel); }; this.fuel.x = (this.windowBmp.x + 16); this.fuel.y = (this.windowBmp.y + 17); this.fuel.width = (this.fuel.width - 5); this.fuelMask = new Shape(); if (newType) { addChild(this.fuelMask); }; this.fuelMask.graphics.beginFill(0, 1); this.fuelMask.graphics.drawRect(0, 0, 1, fuelBitmap.height); this.fuelMask.x = this.fuel.x; this.fuelMask.y = this.fuel.y; this.fuel.mask = this.fuelMask; this.bubblesContainer = new Sprite(); if (newType) { addChild(this.bubblesContainer); }; this.bubblesContainer.blendMode = BlendMode.LIGHTEN; this.bubblesContainer.x = this.fuel.x; this.bubblesContainer.y = this.fuel.y; var filters:Array = new Array(); filters.push(new BlurFilter(3, 0, BitmapFilterQuality.LOW)); this.bubblesContainer.filters = filters; this.bubblesMask = new Shape(); if (newType) { addChild(this.bubblesMask); }; this.bubblesMask.graphics.beginFill(0, 0xFF0000); this.bubblesMask.graphics.drawCircle(this.tubeR, this.tubeR, this.tubeR); this.bubblesMask.graphics.beginFill(0, 0xFF00); this.bubblesMask.graphics.drawCircle((this.tubeL - this.tubeR), this.tubeR, this.tubeR); this.bubblesMask.graphics.beginFill(0, 0xFF); this.bubblesMask.graphics.drawRect(this.tubeR, 0, (this.tubeL - (this.tubeR * 2)), (this.tubeR * 2)); this.bubblesMask.x = this.fuel.x; this.bubblesMask.y = this.fuel.y; this.bubblesContainer.mask = this.bubblesMask; this.showTimer = new Timer(this.showDelay, 1); this.fuelAnimTimer = new Timer(this.fuelAnimDelay, this.fuelAnimPhases.length); this.bubblesAnimTimer = new Timer(this.bubblesAnimDelay, 1000000); this.hideTimer = new Timer(this.hideDelay, 1); this.layer.addEventListener(Event.ENTER_FRAME, this.animFuel); this.bubblesAnimTimer.addEventListener(TimerEvent.TIMER, this.animBubbles); this.bubblesAnimTimer.addEventListener(TimerEvent.TIMER_COMPLETE, this.stopBubblesAnim); var t_i:Timer = new Timer((Math.random() * 7000), 1); t_i.addEventListener(TimerEvent.TIMER_COMPLETE, this.onChangeImage); t_i.reset(); t_i.start(); this.changeProgress(0, 0); this.onShowTimerComplemete(null); this.unlockLoaderWindow(); } как тут правильно прописать public function pict():void для this.image
- Assistant
Чтобы правильно прописать
public function pict():voidдляthis.image, вам нужно обратиться кimageLoaderи вызвать методpict().this.newType = newType; this.layer = Main.systemUILayer; var imageLoader:GTanksI = Main.osgi.getService(GTanksI) as GTanksI; this.image = imageLoader.pict(); // вызов метода pict() для получения изображения this.image.x = 10; this.image.y = 11; addChild(this.window); addChild(this.image);Обратите внимание, что вы должны использовать скобки
()послеpict, чтобы вызвать методpict(). - User
private var image:Loader; этоменять на что ?
- Assistant
Если вы хотите заменить
private var image:Loader, чтобы использовать методpublic function pict():void, вам нужно изменить тип данных переменнойimageнаBitmapвместоLoader.Вот как должна выглядеть модифицированная часть кода:
private var image:Bitmap; // измененный тип данных // ... public function GTanksLoaderWindow(newType:Boolean=true) { this.newType = newType; this.layer = Main.systemUILayer; var imageLoader:GTanksI = Main.osgi.getService(GTanksI) as GTanksI; this.image = imageLoader.pict(); // вызов метода pict() для получения изображения this.image.x = 10; this.image.y = 11; addChild(this.window); addChild(this.image); // ... }После замены типа данных на
Bitmap, у вас будет возможность использовать методpict()для загрузки изображения и назначить его в переменнуюimage. - User
this.image = imageLoader.pict(); // вызов метода pict() для получения изображения
- Assistant
Да, вы правильно применяете метод
pict()для получения изображения. Теперь переменнаяthis.imageбудет хранить результат вызова методаpict()изimageLoader. - User
this.image = imageLoader.pict(); // вызов метода pict() для получения изображения жалуется на pict
- Assistant
Из контекста вашего кода можно предположить, что метод
pict()должен быть определен в классеGTanksIи иметь следующую сигнатуру:public function pict():Bitmap { // внутренняя реализация метода, возвращающая объект Bitmap }Убедитесь, что метод
pict()определен в классеGTanksIи имеет правильный тип возвращаемого значения (Bitmap). Если метод отсутствует или имеет другую сигнатуру, вам нужно обновить его соответствующим образом.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.