Author Topic: How can integrate a new class  (Read 1416 times)

freefromaccoda

  • Newbie
  • *
  • Posts: 9
How can integrate a new class
« on: July 22, 2009, 07:50:00 am »
Hi, my friends. I've developed a new AS3 Class (with its subclasses) for fixing a screen zone and convert to Jpg, and i'd like to integrate it when we enter zoom mode in Megazine 3, applicating its functionallity to the current book page that is just opened.

Will anybody guide me to do it? I've just tried to add an object instance of my class to the 'interface.fla' and to the 'megazine.fla', but it doesn't worked. I know i have to write the code for import and instanciate in the *.AS files, but i can't find where is the code for entering zoom mode is implemented.

Please don't have qualms about the dificult of the explanation, i've been programming ActionScript for years.

Thanks in advance!
« Last Edit: July 22, 2009, 07:59:33 am by freefromaccoda »

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: How can integrate a new class
« Reply #1 on: July 22, 2009, 11:00:23 am »
Zoom mode is implemented in the ZoomContainer class, have a look at that.
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.

freefromaccoda

  • Newbie
  • *
  • Posts: 9
Re: How can integrate a new class
« Reply #2 on: July 23, 2009, 10:33:57 am »
Thanks Florian! It worked implementing in that class.

Some doubts if you don't mind:

Mi class have movieclips and another graphical elements designed in a .FLA file. I've copied theese elements and pasted into the megazine.fla library because in ZoomContainer.as i had to import the .AS of my class and the graphical elements had to be accesed by the code.

Is it the right way? Is there any form to access to my .FLA file from code and use the class and the graphical elements? Should i obtain the same result importing my elements to the interface.fla instead megazine.fla?

Thank you so much.

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: How can integrate a new class
« Reply #3 on: July 24, 2009, 02:06:14 am »
If you plan deeper integration with the MegaZine code, then yes, I'd reccomend you to put your elements into the interface.fla and make it accessible like all the current gui elements, through the LibrarySWF<->LibraryConstants<->Library class. That's the cleanest way I found, although that, too, might not be ideal. But it worked, and that's not one of my favorite topics, so I left it at that ;)
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.

freefromaccoda

  • Newbie
  • *
  • Posts: 9
Re: How can integrate a new class
« Reply #4 on: October 05, 2009, 06:12:58 pm »
Hi, 

i hope you can help me. I did integrate my class in the 1.38 version as you said me, and it worked, but the navigation bar disappeared. In fact, i compile the originals megazine.fla and interface.fla without my class and i'm not able to have available the navigation bar. Both .swf file size are not the same as your originals and i have all the paths and your classes located ok.

I love the 2.0 version and i'd like to integrate my class as a new component, but i don't know how to start, cause in the wiki.magazine i don't find any example of a plugin in .Fla, even where is the .js interaction and how make my component appear when i'm in zoom mode.

Can you guide me or give me a recommendation of where find an example? I have myComponent.fla associated with its class and the swf generated ok. I've declared in the <book plugins="myComponent" ....>, but i don't know where can i make it appear, cause i don't have the megazine.fla and i suppose is not necesary to modify the ZoomContainer.as like in the previous version. Is that?  :'(

Thanks in advance

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: How can integrate a new class
« Reply #5 on: October 06, 2009, 02:08:48 pm »
Zombie thread ;D

Anyways. Regarding 1.38, no idea what's wrong then, sorry. Plus I'm currently not very "fit" regarding 1.38 as I'm very focused on getting v2 done.

Now, as for implementing this for 2.0... if I understand correctly, there are basically two ways of achieving what you want:
a) change the gallery plugin, just like you changed the ZoomContainer before (which is now basically the GalleryFrame, just with less gui layout stuff, as that's handled via asul).
b) write an additional plugin, which listens to the gallery's open / close events and, if necessary then add something more to the pluginLayer (which is the displayobject container containing all "overall" gui stuff, such as the navbar and the galleryframe).

All plugins are in the de.mightypirates.megazine.plugins package, have a look at those. To start a new plugin, copy the dummy one and go from there.

As for compilation, the plugins are not compiled using flas, but are directly compiled using mxmlc (well, I guess you could create a fla which uses the plugin as a document class, though...)
I postet a reply not too long ago describing how to get ant etc set up to do the compiling (will write a Wiki entry on that sooner or later, too).
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.

freefromaccoda

  • Newbie
  • *
  • Posts: 9
Re: How can integrate a new class
« Reply #6 on: October 06, 2009, 02:45:33 pm »
Yes, zombie... jaajajaj, so i was worried.

I knew what happened in 1.38, was for my fault but i'll fight for developing it in 2.0 version as you're saying me, because the zoom mode in 2.0 is better than in the previous one and i was trying to associate my class to an DisplayObjectContainer and the book is a DisplayObject. I'm getting crazy. Both versions are incredible developments that i should have to rebirth again for doing it, even though i'm computer science engineer.

I thought i would not be able to do in the 2.0 version with the resources i have, but i feel hopefull. Thanks so much, my friend.