Jump to content
Korean Random
SV_Kirov

Как создать форму(Окно) в ангаре

Recommended Posts

7 minutes ago, SkepticalFox said:

Use selectedIndex and dataProvider

 

Is it a correct usage?

var _loc_ = this.ddMenu.dataProvider[this.ddMenu.selectedIndex];

 

Share this post


Link to post

Short link
Share on other sites

А где есть гайд для чайников, по Awesomium? Возникает вопрос, где должен быть код и как его компилировать.

Share this post


Link to post

Short link
Share on other sites

Hello,

 

First of all sorry for english but i am using google.translator for this page.

I dont know Flash and AS3 to good but im programming in few other languages.

 

In net.wg.gui.lobby.battleResults.BattleResult.as there are two components named "tabs_mc" and "view_mc" by default setted to null.

    public class BattleResults extends BattleResultsMeta implements IBattleResultsMeta
    {
        public var tabs_mc:ButtonBarEx = null;
        public var view_mc:ViewStack = null;

 

But i dont see any code for creation this components. Can anyone tell me how and where are theye created?

My goal is to create Tab panel and ViewStack like in battleResult window.
Greetings 

 

Share this post


Link to post

Short link
Share on other sites
44 minutes ago, lorkan666 said:

But i dont see any code for creation this components.

They are created in Adobe Flash. This class is used as an element class (not directly usually, but through inheritance with an additional class in root namespace compiled in flash file with element itself) and is a descendant of MovieClip or Sprite trough a long chain of inheritance.

Share this post


Link to post

Short link
Share on other sites

Thank you for quick reply, very clear answer. 

 

One more thing, are names "tabs_mc" and "view_mc" have any role in Adobe Flash program? Im trying to understand how "linkage" works and i quess this names are exactly this?

Also, is any way to instatiate them via AS3 code like other controls in this Topic?

I believe im trying understand how to make own skin for controls to prevent loading all SWFs.

Share this post


Link to post

Short link
Share on other sites
13 hours ago, lorkan666 said:

One more thing, are names "tabs_mc" and "view_mc" have any role in Adobe Flash program?

Of course they are. Definition of these attributes for a class instance is nothing else than making a placeholder for real sub-objects created in Adobe Flash. Sub-objects (named children) in Adobe Flash have their names that match var names in class definition. These variables (attributes) are always public. They (sub-objects) are also inaccessible by their names without these declarations, so in most cases variables (attributes) are declared, but leaved undefined or preset to null. Most public attributes that preset to null are named children or DAAPI entities. DAAPI is the Direct Access API, it is used for linking Python and ActionScript, more information could be found here (examples are outdated, but structural information is still actual).

13 hours ago, lorkan666 said:

Also, is any way to instatiate them via AS3 code like other controls in this Topic?

Objects created in Adobe Flash is already instantiated as a single copy. The only way to get a copy is to make a copy... but I don`t know if it is possible at all (without copying object in Adobe Flash).

13 hours ago, lorkan666 said:

I believe im trying understand how to make own skin for controls to prevent loading all SWFs.

If you want to replace something you gotta replace it directly, that means you have to edit an existing flash file. To add something in most cases it is enough to add an external flash document with the injection code. ActionScript (unlike Python) is not monkey-patch-friendly, so it is really hard to replace any object in run-time, sometimes possible of course but done a real tricky way hard to understand even for advanced ActionScript coders.

Share this post


Link to post

Short link
Share on other sites

 Приветствую всех.

 

@SkepticalFoxТы не мог бы слегка освежить и дополнить информацию из этого поста для начинающих, как я? 

Библиотеки каким-то чудом были найдены на битбакете, но при пошаговом повторении возникла проблема.

 

Буду рад, если кто подскажет в чем проблема

 

Main.as

package
{
	import flash.display.Sprite;
	import flash.events.Event;

	public class Main extends Sprite 
	{
		private var tw     : TestWindow
		
		public function Main() 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			tw = new TestWindow();
		}
	}
}

TestWindow.as

package
{
    import net.wg.infrastructure.base.AbstractWindowView;
    import net.wg.gui.components.controls.SoundButton;
    import flash.text.*;

    public class TestWindow extends AbstractWindowView
    {
        private var soundButtonOk     : SoundButton;
        private var soundButtonCancel : SoundButton;
        private var textFieldTest     : TextField;

        public function TestWindow()
        {
            super();
        }

        override protected function onPopulate() : void
        {
            super.onPopulate();
            width = 600;
            height = 400;
            window.title = "Test Window";

            textFieldTest = new TextField();
            textFieldTest.width = 590;
            textFieldTest.height = 360;
            textFieldTest.x = 5;
            textFieldTest.y = 0;
            textFieldTest.multiline = true;
            textFieldTest.selectable = false;
            textFieldTest.defaultTextFormat = new TextFormat("$FieldFont", 10, 0xFFFFFF);
            textFieldTest.text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
            addChild(textFieldTest);

            soundButtonOk = addChild(App.utils.classFactory.getComponent("ButtonNormal", SoundButton, {
                width: 100,
                height: 25,
                x: 195,
                y: 365,
                label: "Ok"
            })) as SoundButton;

            soundButtonCancel = addChild(App.utils.classFactory.getComponent("ButtonNormal", SoundButton, {
                width: 100,
                height: 25,
                x: 305,
                y: 365,
                label: "Cancel"
            })) as SoundButton;
        }
    }
}

Смущает однако, что после компиляции .swf с моим классом пустой, и собственно, при запуске я кнопочек не вижу.

image.thumb.png.1a9c0cce85d694ae93edc8d277fb937b.png

 

 

Может кто дать наводку?

 

 

Share this post


Link to post

Short link
Share on other sites
7 минут назад, Saxep сказал:

 Приветствую всех.

 

@SkepticalFoxТы не мог бы слегка освежить и дополнить информацию из этого поста для начинающих, как я? 

Библиотеки каким-то чудом были найдены на битбакете, но при пошаговом повторении возникла проблема.

 

Буду рад, если кто подскажет в чем проблема

 

Main.as


package
{
	import flash.display.Sprite;
	import flash.events.Event;

	public class Main extends Sprite 
	{
		private var tw     : TestWindow
		
		public function Main() 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			tw = new TestWindow();
		}
	}
}

TestWindow.as


package
{
    import net.wg.infrastructure.base.AbstractWindowView;
    import net.wg.gui.components.controls.SoundButton;
    import flash.text.*;

    public class TestWindow extends AbstractWindowView
    {
        private var soundButtonOk     : SoundButton;
        private var soundButtonCancel : SoundButton;
        private var textFieldTest     : TextField;

        public function TestWindow()
        {
            super();
        }

        override protected function onPopulate() : void
        {
            super.onPopulate();
            width = 600;
            height = 400;
            window.title = "Test Window";

            textFieldTest = new TextField();
            textFieldTest.width = 590;
            textFieldTest.height = 360;
            textFieldTest.x = 5;
            textFieldTest.y = 0;
            textFieldTest.multiline = true;
            textFieldTest.selectable = false;
            textFieldTest.defaultTextFormat = new TextFormat("$FieldFont", 10, 0xFFFFFF);
            textFieldTest.text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
            addChild(textFieldTest);

            soundButtonOk = addChild(App.utils.classFactory.getComponent("ButtonNormal", SoundButton, {
                width: 100,
                height: 25,
                x: 195,
                y: 365,
                label: "Ok"
            })) as SoundButton;

            soundButtonCancel = addChild(App.utils.classFactory.getComponent("ButtonNormal", SoundButton, {
                width: 100,
                height: 25,
                x: 305,
                y: 365,
                label: "Cancel"
            })) as SoundButton;
        }
    }
}

Смущает однако, что после компиляции .swf с моим классом пустой, и собственно, при запуске я кнопочек не вижу.

image.thumb.png.1a9c0cce85d694ae93edc8d277fb937b.png

 

 

Может кто дать наводку?

 

 

Питон часть мимо пропуслили видимо

Share this post


Link to post

Short link
Share on other sites

Тема с питоном как-то не очевидна мне.

1. Я не понял нужно ли его скомпилировать? 

2. Где взять библиотеки?

3. Куда надобно его разместить?

4. FlashDevelop не дает возможности увидеть форму (отрисованные кнопки хотя бы)? я полагал, что питон отвечает за непосредственную обработку кода, вызванного хендлерами .as. Это не так?

Edited by Saxep

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...