Author Topic: Navigation Buttons above and below Megazine  (Read 5941 times)

Afroshok

  • Guest
Navigation Buttons above and below Megazine
« on: October 01, 2009, 12:43:42 PM »
Hi Florian,

First, having dabbled in Flash for about 3 years, and coming back to it once in a while, I must thank you very much for producing "The Megazine".
Its serious business. I tried making a flip-book with the free solutions out there and some tape and wire and I realised how tough it would be to get what I wanted. AS3 - ???

So after looking at Uli Blasi's site, I was shocked to see what you were offering for free considering the other solutions out there.
I am a designer more than a coder and without too much hand-holding, I was wondering what are the steps to go through to work with a custom interface and the ASUL to get to a site like Uli's.

And how would one get buttons above and below the Megazine.

Thanks

Hans Nücke

  • Administrator
  • Hero Member
  • *****
  • Posts: 960
  • MegaZine3 Sales Manager
Re: Navigation Buttons above and below Megazine
« Reply #1 on: October 01, 2009, 02:50:55 PM »
We'll take you by the hand; soon ;-)

I am actually preparing tutorials that will give you a step by step introduction.
The intention is to provide everything you need in just following the steps sketched out.
With the result of creating a first sample and simple book.

And following the next (planned) tutorials you'll learn more about the secrets of most of all those parameters listed in the documentation; and how to use them.

This is quite some work, so I cannot promise a committed date, but my expectation is to have the first basic tutorial ready this week!

This will be published under "Tutorials" in this forum (most probably under "Video Tutorials on YouTube", since I will put that also as video on YouTube).
Please watch closely this link: http://megazine.mightypirates.de/forum/index.php/topic,427.0.html

The first tutorial in this forum would be based on version 1.38, but similar ones will follow soon for version 2.0.
Those will be made available in the wiki at http://megazine.mightypirates.de/wiki

Afroshok

  • Guest
Re: Navigation Buttons above and below Megazine
« Reply #2 on: October 01, 2009, 03:01:19 PM »
You are the Man!

That's very good to hear. I'm pulling out my hair trying to figure it out.
And thanks for the quick reply.

Be Strong.


Afroshok

  • Guest
Re: We are here!
« Reply #3 on: October 15, 2009, 03:33:04 PM »
Hi Hans,

This is where I have arrived at (see attached). The buttons at the top are what I would like to insert as the second bar of navigation buttons.
The bottom are the reworked MegaZine gui buttons. After going through the navigationbar.asul, I found I didn't know how to indicate for a "navigationbar2.swf".

I looked at Kenny Alan Cramer's site (http://www.kennyalancramer.com/) and his portfolio that incorporates MegaZine uses custom buttons that are anchors to the MegaZine pages.
However it seems he built his site with version 1.38 with the interface.fla. So I tried experimenting with HTML and found that my HTML buttons disappear when one goes full screen.

My question is, do I use version 1.38 to create my interface that incorporates both navigation bars or in version 2.0, is there a way of including a second nav bar using this new and elegant .asul system?


Afroshok

  • Guest
Re: Any help please?
« Reply #4 on: October 20, 2009, 04:52:48 PM »
Hi Hans and Florian,

I do know you are quite busy finishing up the MegaZine 2.0. However I am expected to launch this site soon and I need to understand whether its possible to get "extra" user-specified buttons apart from the ones in the engine.

Any help please on the direction to take would be appreciated.

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1979
  • MegaZine3 Developer
    • MegaZine3
Re: Navigation Buttons above and below Megazine
« Reply #5 on: October 20, 2009, 08:47:39 PM »
To add additional buttons I'd recommend you to write your own little plugin.

If it's an extra bar (like in you image) that's pretty simple, just create the GUI definitions in the ASUL file for the plugin and add the functionality by getting the elements using the deepGetChildByName function (call it on the outermost container, the one you create using createAsulObject(id:String)). If you want the buttons in the original navbar, add them in the navigationbar.asul and add the functionality by starting at the pluginLayer when using the deepGetChildByName (make sure your plugin declares a dependency on the navigationbar plugin in that case, to make sure it exists when the initialize function of your plugin is called).

So basically, copy Dummy plugin, in constructor declare ASUL definitions (and, if adding to the navigationbar plugin, add the new Dependency("navigationbar")):
If it's a completely separate bar
Code: (actionscript3)
  1. public function SecondBar() {
  2.    super("secondbar", "1.0.0", [], true, true);
  3. }

If it's integrated into the original navbar
Code: (actionscript3)
  1. public function SecondBar() {
  2.    super("secondbar", "1.0.0", [new Dependency("navigationbar")], true, true);
  3. }

The last argument tells the engine to try and load localized strings for the plugin. If you don't use any (or hardcode them in asul files) you can remove that.

Assuming you ASUL looks somewhat like this:
Code: (xml)
  1. <asul>
  2. <!-- ... -->
  3. <box id="secondbar">
  4.    <!-- Your buttons -->
  5.    <button name="button1">...</button>
  6.    <!-- ... -->
  7. </box>
  8. </asul>

The initialize function has to do the following:
Code: (actionscript3)
  1. override protected function initialize():void {
  2.    var secondBar:IAsulObject = createAsulObject("secondbar") as IAsulObject;
  3.    if (secondBar) {
  4.        var button1:DisplayObject = secondBar.deepGetChildByName("button1");
  5.        if (button1) {
  6.            button1.addEventListener(MouseEvent.CLICK, handleButton1Click);
  7.        }
  8.        // ...
  9.        megazine.pluginLayer.addChild(DisplayObject(secondBar));
  10.    }
  11. }

If you have additional buttons in the navigationbar:
Code: (actionscript3)
  1. override protected function initialize():void {
  2.    var button1:DisplayObject = IAsulObject(megazine.pluginLayer).deepGetChildByName("button1");
  3.    if (button1) {
  4.        button1.addEventListener(MouseEvent.CLICK, handleButton1Click);
  5.    }
  6.    // ...
  7. }

There'd be the third possibility of defining the buttons in your ASUL, creating them (createAsulObject) and adding them to the navigationbar via the addButton function, but I think this is enough for now :P
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Afroshok

  • Guest
Re: Navigation Buttons above and below Megazine
« Reply #6 on: October 21, 2009, 05:06:18 AM »
Darn it! I thought I would get away without writing anything. ;D

Thanks Florian, will do immediately I finish looking into the new build. I had no idea you were up to releasing the new 2.0 today.
Very good work. I suppose I'l have to dust the "cookbook" and make the plugin.

I should post my solution here once I sort it.

Thanks again and expect to hear from me soon.

Hans Nücke

  • Administrator
  • Hero Member
  • *****
  • Posts: 960
  • MegaZine3 Sales Manager
Re: Navigation Buttons above and below Megazine
« Reply #7 on: October 30, 2009, 02:05:19 AM »
Florian created a new Tutorial and already published it in the wirki:
Here: New Tutorial - How to write a Plugin

Afroshok

  • Guest
Re: Navigation Buttons above and below Megazine
« Reply #8 on: October 31, 2009, 04:35:42 PM »
As we say here in Kenya,

"No jokes" ;D.

Thanks a lot Hans, I dusted that "cookbook" and ... cough... cough...it had too much dust. This is easier to see ;).