Jump to content
Korean Random
Sign in to follow this  
jeroohn

Помогите разобратся с флешем

Recommended Posts

Возникла насущная необходимость разобраться с флешевыми модами.

 

решил экспериментировать на Some0ne'овском моде каммуфляжей в силу простоты флеша там.

res_mods.zip

 

беру из мода файл MyWindow.swf

 

открываю его декомпилом. кроме одного скрипта ничего там не вижу

выдергиваю его.

'текст скрипта'

package net
{
import net.wg.infrastructure.base.AbstractWindowView;
import net.wg.gui.components.controls.SoundButtonEx;
import net.wg.gui.components.controls.DropdownMenu;
import net.wg.gui.components.controls.CheckBox;
import net.wg.gui.components.controls.TextFieldShort;
import scaleform.clik.events.ButtonEvent;
import scaleform.clik.data.DataProvider;

public class MyWindow extends AbstractWindowView
{

public function MyWindow() {
super();
this.canClose = true;
this.isCentered = true;
}

public var callFromFlash:Function = null;

public var submitBtn:SoundButtonEx;

public var cancelBtn:SoundButtonEx;

public var ddMenu:DropdownMenu;

public var cbUse:CheckBox;

public var tfLabel:TextFieldShort;

public var copyLabel:TextFieldShort;

override protected function configUI() : void {
this.window.title = "Настройки ангара";
this.window.setTitleIcon("team");
this.submitBtn.label = "#settings:apply_button";
this.cancelBtn.label = "#settings:cancel_button";
this.submitBtn.width = this.cancelBtn.width = 90;
this.submitBtn.addEventListener(ButtonEvent.CLICK,this.handleSubmitBtnClick);
this.cancelBtn.addEventListener(ButtonEvent.CLICK,this.handleCancelBtnClick);
this.cbUse.setSize(250,20);
this.cbUse.label = "Использовать случайный камуфляж";
this.tfLabel.label = "Камуфляж:";
this.tfLabel.y = this.tfLabel.y + 2;
this.tfLabel.showToolTip = false;
this.tfLabel.selectable = false;
this.tfLabel.textSize = this.cbUse.textSize;
this.tfLabel.textColor = this.cbUse.textColor;
this.tfLabel.textFont = this.cbUse.textFont;
this.ddMenu.rowCount = 3;
this.ddMenu.menuDirection = "down";
this.ddMenu.itemRenderer = "DropDownListItemRendererSound";
this.ddMenu.dropdown = "DropdownMenu_ScrollingList";
this.copyLabel.label = "© S0me0ne";
this.copyLabel.showToolTip = false;
this.copyLabel.selectable = false;
this.copyLabel.textSize = this.cbUse.textSize;
this.copyLabel.textColor = this.cbUse.textColor;
this.copyLabel.textFont = this.cbUse.textFont;
}

override protected function onPopulate() : void {
super.onPopulate();
this.setSize(300,110);
this.window.useBottomBtns = true;
var _loc1_:Array = new Array();
_loc1_.push(
{
"label":"#tooltips:customization/camouflage/winter",
"data":"winter"
});
_loc1_.push(
{
"label":"#tooltips:customization/camouflage/summer",
"data":"summer"
});
_loc1_.push(
{
"label":"#tooltips:customization/camouflage/desert",
"data":"desert"
});
this.ddMenu.dataProvider = new DataProvider(_loc1_);
}

public function handleSubmitBtnClick(param1:ButtonEvent) : void {
var _loc2_:* = this.ddMenu.dataProvider[this.ddMenu.selectedIndex];
this.callFromFlash(
{
"camo":_loc2_.data,
"random":this.cbUse.selected
});
}

public function handleCancelBtnClick(param1:ButtonEvent) : void {
this.onWindowClose();
}

private function getIndexByData(param1:String) : int {
var _loc2_:* = undefined;
for (_loc2_ in this.ddMenu.dataProvider)
{
if(this.ddMenu.dataProvider[_loc2_].data == param1)
{
return _loc2_;
}
}
return -1;
}

public function as_callToFlash(param1:*) : void {
this.ddMenu.selectedIndex = this.getIndexByData(param1.camo);
this.cbUse.selected = param1.random;
}
}
}

 

в флеш девелоп создаю AS3 проект

добавляю в него этот текст

в настройки проекта добавляю внешнюю бибилиотеку wg.swc

компилю ничего не изменяю в исходном файле

заменяю оригинальный MyWindow.swf своим

запускаю клиент

не работает =(((

 

мой проект из флеш девелоп

test.zip

 

получившаяся флешка

MyWindow.swf

 

питон лог


/------------------------------------------------------------------------------\
BigWorld Release Client (compiled at 12:47:26 Dec 16 2013) starting on Sun Jan 19 12:44:29 2014
Checking ./res_mods/0.8.10: mods found
[XPM] preloader gui.Scaleform.locale
[XPM] Working dir: ./res_mods/0.8.10/scripts/client/gui/mods
[XPM] Loading mod: xvmstat 1.0.3 (http://www.modxvm.com/)
LoadMod: camo
LoadMod: exel
LoadMod: ShowDamage
[NOTE] (scripts/client/post_processing/__init__.py, 275): The quality = 1 was selected.
[NOTE] (scripts/client/post_processing/__init__.py, 275): The quality = 1 was selected.
The actual Cache found for player  jeroohn
[SPACE] Loading space: spaces/hangar_premium
[ERROR.GUI] (scripts/client/gui/Scaleform/Flash.py, 261): TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at net.wg.infrastructure.base::AbstractView/onPopulate()[E:\flash_mod\test\src;;MyWindow.as:76]
	at net.wg.infrastructure.base::AbstractView/as_populate()
	at net.wg.infrastructure.base.meta.impl::LoaderManagerMeta/viewLoadedS()
	at net.wg.infrastructure.managers::LoaderManager/onSWFLoaded()
[EXCEPTION] (scripts/common/Event.py, 34):
Traceback (most recent call last):
  File "scripts/common/Event.py", line 32, in __call__
  File "scripts/client/gui/Scaleform/framework/managers/containers.py", line 557, in __loader_onViewLoaded
  File "scripts/client/gui/Scaleform/framework/entities/DisposableEntity.py", line 17, in create
  File "E:\GDisk\camo.py", line 58, in _populate
    'random': userandom.lower() == 'yes'})
  File "E:\GDisk\camo.py", line 78, in callToFlash
    self.flashObject.as_callToFlash(data)
Exception: PyGFxValue - Failed to invoke method as_callToFlash.
PostProcessing.Phases.fini()
\--------------------------------------------------------------------------------/

Во флеша нуб. Что я делаю не так?

Share this post


Link to post

Short link
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...