A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: java swf

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    9

    java swf

    Hi all,

    I'm just wondering if anyone is interested in contributing to my project. I have set up a website (and project) at http://jswf.sourceforge.net

    The project is aimed at the open source community with the goal of creating a set of java classes which export to the swf file format.

    I would be very greatfull for any help.

    Thanks

    Chris

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Heck I'll more than help you;

    This has already been done; http://www.anotherbigidea.com/javaswf/index.html

    and there are several tools using it most notably http://drawswf.sourceforge.net/

    Likewise there is a comercially liscensed set of classes here http://www.flagstonesoftware.com/translate/

  3. #3
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080


    i think we both are trying to do the same thing

    http://www.flashkit.com/board/showth...hreadid=430322

    I got an idea, i'm hoping to make some commercial software (i believe in opensource, but i really need money)....so i'm experimenting with the SWF format aswell.....

    And I do believe it's a great idea of making this swf library....just because someone did it before you, doesn't mean you can make it again, and improve it, which MUST be the case.....JAVASWF from anotherbigidea.com, if i'm not wrong, generates swf files version 4, maybe 5....but version 6 has a lot more to offer.

    Before I chose JAVA as the programming language for my library, i did a little research, and i noticed something.....there are almost no resources for SWF developers (yes, www.openswf.org is nice, but there is shown that there's about 10 projects that think in developing libraries for SWF files)....I guess that this is a great chance...why? because there are few people developing software that aid flash developers (well SWIFT 3d is the most amazing one), and that gives you a great market....if you have your own JAVA SWF library, you got it man....you can develop everything you want (from a Actionscript decoder like SWF Decompiler, or the Buraks Actionscript viewer), to software like FLAX (im sorry i dont have the links to all the stuff im mentioning), which aids you to create nice text effects, or swish....java gives you the advantage of CROSSPLATFORM (i was going to choose DELPHI, but i don't know that language).....

    I think every flash developer stays in the design state (almost everyone that uses flash, from my point of view, is a designer, not a programmer)...that's why Actionscript, which is an excellent language, is not well used in most websites (the best actionscript can be viewed in sites like www.levitated.net, or ww.uncontrol.com i think, and those guys are programmers, that's why their flash experiments look so great)......usually designers stay in the basic actionscripting (im talking about the main part, but not everyone is like that).....

    So, anyway, i think a new JAVA SWF library is great.....but u gotta have a goal....why do you need it? just because? or is there something you're aiming to develop when you have our library finished??????
    Last edited by argonauta; 03-04-2003 at 08:45 PM.
    my blog: blog.innocuo
    Sponsored by your mom.

  4. #4
    Junior Member
    Join Date
    Feb 2003
    Posts
    9
    I am aware of the other project johnie, and I reviewed the source etc before starting this. The reason for continuing with the project is primarily because I am sure the open source community would benefit from more than one view point with regards to java and swf files. As far as I can see, the more resources, the better! As argonauta said, the resources available to java programmers interested in the swf file format are very limited.

    Also, I have no intention of parsing XML documents, jswf will be based purely on java.

    Any comments would be greatly appreciated,

    Chris

  5. #5
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    hey chris. Would you like to contact me? so far, i think we are on the same plan!

    azrasta1@yahoo.com
    my blog: blog.innocuo
    Sponsored by your mom.

  6. #6
    Junior Member
    Join Date
    Feb 2003
    Posts
    9
    argonauta, again I appreciate your interest.

    May I ask a favor? Can all communications between us be via this board. Like I said, I'm doing this for my Master's project and it would be nice if I could include all conversations etc from one place. Not only that, others may be able to benefit from what we say.

    Are you serious about helping out? If so - excellent!

    I'm currently working on Shape Records. I'll be posting a new "build" on http://jswf.sourceforge.net any time soon. I am hoping to include a method called "createRectangle()". It will be passed the height & width of the rectangle, plus the line style and fill style. Other improvements I am hoping to make include a single method for the header-tag creation. This will be the third level of the framework i.e.

    1st - Simple Data Types
    2nd - Tags
    3rd - Method creation

    Any comments, post them here!

    Also, please download the source and comment on what has been done so far.

    Hope this is ok,

    Chris

  7. #7
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    ok. i think i'm ahead of you in this if you check my other post, i also have a library.

    What it can do:

    create a movie, create shapes(you can draw them, or there's also a drawRectangle method). Shapes can be filled with solid colors, or with pics, also, you can add the linestyles you want. You can put them wherever you want in the movie, and add the number of frames you want. My next step is shape morphing.

    Basically i want to keep my code private for now, but here are some guidelines.

    Every byte you write, should be written to a ByteArrayOutputStream object (except for the header), that way you could then get the size of the ByteArray and put in the header (there's a byte where the file size must be written)....and then put everything in an DataOutputStream object.....that also works for tags: you gotta know how many bytes your tags has, so, write everything, except the header in an ByteArrayOutputStream , then count the bytes, and start writing the header in a new ByteArrayOutputStream and add the other ByteArrayOutputStream. I hope i make myself clear.

    Also, for shapes:

    what i do is i create a MOVIE object. Independentlly I create shape objects. Then i put everything together.So it's something like this:

    Code:
    movie mymovie=new movie();
    shape myshape=new shape();
    myshape.addlinestyle(1,0xcc,0xcc,0xcc);
    myshape.addfillstyle(0,0,0,0);
    myshape.addline(0,10);
    myshape.addline(30,-30);
    myshape.endshape(); //this writes the shape tag to a bytearray
    
    mymovie.addshape(myshape);
    mymovie.showshape(myshape);
    mymovie.addframe(1);
    
    etc
    i hope this can help, or if you need further comments or more explanation about how it could work
    my blog: blog.innocuo
    Sponsored by your mom.

  8. #8
    Junior Member
    Join Date
    Feb 2003
    Posts
    9
    I understand if you want to keep your code private, that is fair enough.

    Your code is very similar to what I am working on; however, there is one difference. I have created a BIT writer stream which can write individual bits passed to it as strings of 1's & 0's. This is because allot of the tags (i.e. record header tags etc) require manipulation at the bit level. My simple data type classes convert java's simple data types into what I call bitStrings. These are then passed to the bitStreamWriter class which writes the swf.

    The other reason why I decided to do it this way was that only a few of my classes (the bitStreamWriter class, and simple data type classes) uses bitwise operators. This, in my opinion makes the code easier to read as most of the manipulation is done at the String level.

    If you do not want to share your code, would you be interested in sharing your knowledge? I am hoping to write tutorials on how to do all of this stuff and I would love some help writing them.

    Thanks again for the response

    Chris

  9. #9
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    well, i'm not such an expert. i just pick swf files to learn JAVA, as i didn't know JAVA before this one...so i learn while i write the program although i got a pretty good background in design and scripting, and programming in visual basic.

    Anyway, what do you want to do, write tutorials on how to develop a library like this one, or a tutorial on how to use your library????

    And, well, i keep the code private cause i'm a messy programmer, i think i should clean it before i publish it. But if i can help you in anything, i might help, no problem.

    I think i like your idea. However, instead of working with strings, i like working with objects....i mean, i don't use bytes at all, until i want to render something.

    So, for example, in a shape, i create a shape object, i draw, i put linestyles, fillstyles, change this, delete that, redraw, but no byte code is really written until i ask for it with a method (lflwritebytes() or whatever it could be). So for me, i just don't even care for bytes, but just in the structure of the objects.

    For example, my HEADER class, can be used by any tag...the constructor just need the type (for example 9 for background), and the bytearray that is being used, and it generates the bytecode automatically....that way, i just care in developing objects, and not that much in the output.


    Once you understand the bytes structure of a swf file, you have over 50% of your work done.

    My plans are to develop the library for one more month (i work on my freetime, so i don't have that much time), and then comes the hard part: actionscript....add an actionscript library to the swf library...

    Anyway. From my point of view, tutorials are useless in this case, cause this is kinda technical stuff....i mean, normal users won't know what to do with a java library, most users won't know what java is .....but developers would only need documentation about classes and methods, that's all....you could focus, instead of tutorials, in writing little apps for end users, like the one i posted here in this forum, in another thread....that transforms jpg's into swf....man is simple, and it helps a lot....i already converted 50% of all my images to swf files, as they take less space, and are easier to work with.


    Anyway, again, if you need help, don't hesitate to ask
    my blog: blog.innocuo
    Sponsored by your mom.

  10. #10
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Originally posted by chrisEvans
    I am aware of the other project johnie, and I reviewed the source etc before starting this. The reason for continuing with the project is primarily because I am sure the open source community would benefit from more than one view point with regards to java and swf files. As far as I can see, the more resources, the better! As argonauta said, the resources available to java programmers interested in the swf file format are very limited.


    Any comments would be greatly appreciated,

    Chris
    There are 3 Java SWF libraries already. I posted two of them. This is a third http://sourceforge.net/projects/jgen/ (Under the Apache license)

    There is a Fourth and Fith Project which have not put out any code yet to do the same thing at Source Forge- all in Java.

    The Bright Idea library is under a BSD liscense. As such you would start there and improve it. Under a BSD license you could build on their code.

    SWF Generator can output to Flash 6 the Non Open Flagstone Library can output to Flash 5 http://www.flagstonesoftware.com/index.html .

  11. #11
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    hi chris, i wanted to know....you have any improvements in your library????

    i'm working in mine, going into shape morphing now....it's quite nice now, although i'm redesigning it....the purpose:

    for example....i created a class called LIBRARY: there you create all of your shapes, and can be "exported" to other movies (the same concept as in Flash).....not only that: FillStyles and LineStyles can be put in a Fill, and a Line Array (apart from the arrays for each shape)....so then i create a "library" of fills and lines that i can use and reuse over and over again, making the process of creating a movie even simpler.

    That's an idea, maybe it's good and you'd like to implement.....

    anyway, what is your progress up to now?
    my blog: blog.innocuo
    Sponsored by your mom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center