Google Answers Logo
View Question
 
Q: Put GUI on SVG to SWF Translate Tool ( No Answer,   0 Comments )
Question  
Subject: Put GUI on SVG to SWF Translate Tool
Category: Computers > Graphics
Asked by: author20-ga
List Price: $100.00
Posted: 25 Dec 2003 11:02 PST
Expires: 24 Jan 2004 11:02 PST
Question ID: 290240
Put a GUI on SVG draw & convert utility
=======================================

Can you create a simple prototype using the below tools? 

1. drawing & effects tool (see middle of page of URL)
2. SVG to SWF convertion tool (scriptable graphics & conversion)

You could use the drawing tools at:

Drawing:
========
http://actionscript-toolbox.com/samplemx_shapeeditor.php

Effects:
========
http://actionscript-toolbox.com/shapeDefinedMC.php


Code conversion code at:

http://www.eskimo.com/~robla/svg2swf/

to do a SWV create, SWF convert process -- would complete first phase of project!

Can you create a sample prototype drawing & conversion utility with
the free code that is out there?

Clarification of Question by author20-ga on 26 Dec 2003 07:41 PST
Hi,  

Below is a detailed outline of the complete tool, with conversion
being the last step. I will attempt to phone you and talk about this
project.

Here is some clarification on the spec:

1. Create Graphics shapes (wire frames , or solid filled) form the XML/SVG input 

2. Following shapes are to be implemented
   a. Rect
   b. Circle
   c. Ellipse
   d. Line
   e. PolyLine
   f. Polygon

3. Following effects are to be implemented
   a. Emboss, 
   b. Glow 
   c. Bevel effects. 
   d. Drop shadows 
   e. Ground shadows
4. A graphical interface is to be implemented so that above mentioned
shapes can be selected and drawn using drag drop and effects can be
applied.
5. The final image can be converted to SWF file 

6. The development language used will be a client-based technology
such as Visual C++ 6.o

7. Final implementation of the tool will be provided as an executable package.

Request for Question Clarification by webadept-ga on 27 Dec 2003 09:22 PST
So you are looking for something like this system 
http://www.eddiecat.us
Only as a C++ program on a desktop, rather than a web application. Right?

Glows, Shadows and other "fuzzy" stuff in Vector graphics don't work
very well. I'm sure there is a way of doing it, but some real heavy
tie in's with ImageMagick or some library of that sort is going to be
used. Shapes and sizing is no problem, but the more "editing"
available, the greater the cost in R&D.

You've given a good price for this, but I'm really not sure an answer
at this price would fulfill your need with the language chosen. C++ is
rarely a "fast" development tool. Especially when there are libraries
like Ming, and SWF Perl and several others which have a great deal of
this work done for you already. The translation to a C++ tool would be
quite a job, probably several months for "ready for primetime" code.
Writing from scratch, even longer. Whereas in Perl the translation
from SVG to SWF files is relatively fast. If you are using a tool
base, such as Visual Studio NET, Perl can be used to create
components, which can then be used in a C++ program (I don't know much
about this, I just got the Visual Studio NET system to use for this
very thing).

There is a list of Open Source and other Editors at :
http://www.w3.org/Graphics/SVG/SVG-Implementations

Which might be of some help to you, and the development team, be sure
to read the OpenSource license or whatever license they are using
carefully before adapting any code. Another place of interest for you
might be the batik project on the Apache website.
http://xml.apache.org/batik/

It is in Java, but a great deal could be learned from the work they have done. 

Unfortunately many of the SVG standards are not well applied yet. This
is a problem with designing SVG graphics right now for real world use.
Correl and Adobe?s systems can?t seem to agree on what is what and how
the files should be formatted, and they change quite often. This is
very clear when you import SVG images, which have used Filters, and
the effects they create (this would be your Glow and Shadows). The
Batik guys talk quite a bit about his. Getting these effects out into
a Tiff or a PNG file is proving quite the task? getting them into a
SWF format? I?m not really sure how that could be done really, not in
the way the Filters look.

Since SVG can be "programmed" to animate and do many of the image
functions done by SWF, I do wonder why you are choosing to go this
route. Why not just leave it as an SVG and let the browser viewers
deal with the way it looks. I say this because, just making the SVG
viewer is a heavy task in itself, unless you go with an OpenSource
system where this is already done, and translate to C++.

I wish you all the best in your project and hope to see it
accomplished. If you think there might be some help I could give you,
or you would like some futher information, just let me know.

webadept-ga

Request for Question Clarification by webadept-ga on 27 Dec 2003 09:33 PST
By the way, the svg2swf python script you used as your example, is
probably the best I've seen out there, and I've been through a great
deal of code in the last couple of years (and written quite a bit
myself). You do have the advantage of "controling" the SVG that is
created, in your editor, but importing alreay created SVG files into
your system is still going to be a problematic chore. I've tested this
particular svg2swf converter on serveral files, and exports, and have
always had to tweak the svg to get it to work. Some I simply couldn't
get to work at all. Creating them using the actionsript-toolbox method
had most of the problem areas, where the script simply failed to
understand what was needed.

Perhaps if you could shead some light on what the SWF file's purpose
in life would be after it was created, I might be able to help futher.
I keep thinking that if you are simply doing this so that the created
image could be viewed on a website by all the browsers capable of
seeing a flash image, there are better ways of doing this. Your
editor, as you have described it, is creating a single frame SWF file.
Running your SVG through the ImageMagick Convert utility will change
it to a PNG file (or anything else for that matter). And if you still
wanted to have the SWF file, a small, 20 line Perl script will arrange
that for you.

webadept-ga

Clarification of Question by author20-ga on 27 Dec 2003 15:24 PST
I agree. Any client-based language would be OK. As a matter of fact,
that Batik or that Python app  might be acceptasble on a PC, if one
could make it easy to implement.

Javascript/CSS is being done by one company -- 
http://www.dbxgeomatics.com/

The action-script shape and effect editors here are good --
http://actionscript-toolbox.com

Also, a simple conversion program would allow me to pre-build lots of
shapes and effects

Effects can be simulated by using layered mirror shapes with
transparency will do, and the gradient fill will suffice for emboss),
and bevel is just two lines with a smaller line on the inside or
outside.

With a pre-built library of SVG shapes and behaviors, I could then
allow users to only change their scale -- with a mouse. And then
convert to swf.

Can you use PHP to do this? Or use the Phyton converter to a PC
package witha  good GUI?
Put a GUI on SVG draw & convert utility
=======================================

Can you create a simple prototype using the below tools? 

1. drawing & effects tool (see middle of page of URL)
2. SVG to SWF convertion tool (scriptable graphics & conversion)

You could use the drawing tools at:

Drawing:
========
http://actionscript-toolbox.com/samplemx_shapeeditor.php

Effects:
========
http://actionscript-toolbox.com/shapeDefinedMC.php


Code conversion code at:

http://www.eskimo.com/~robla/svg2swf/

Clarification of Question by author20-ga on 27 Dec 2003 15:31 PST
Purpose -- Instant creation of intelligent buttons, tabs, menu items,
and animated shapes for insertion and floating in new and existing
pages.

Buttons would also be inserted inside of swf files.

Can you recommend a way to implement 100% success during the editing /
conversion process?

Also, do you know of a way to insert this SVG parser into my flash
code? If I can get the actionscript affects and svg parsing, that
would be a nice first step:

http://actionscript-toolbox.com/samplemx_translatesvg2.php

Clarification of Question by author20-ga on 27 Dec 2003 15:53 PST
See middle of page for Parse SVG inside of SWF

http://actionscript-toolbox.com/shapeDefinedMC.php

I would be satisfied to do this, and wonder if you can create an
action-script that can create an SWF movie that will parse any SVG
file that is equal or less than its size?

Here is an illustration -- see SVG parased by SWF file in middle, and
let me know if you can implement his ASAP, with a PHP configurator
that can insert a specified SVG file inside of a specified SWF movie.
In other words, customize the envelope and the SVG contents. See
attached illustration.

http://actionscript-toolbox.com/shapeDefinedMC.php

Request for Question Clarification by webadept-ga on 28 Dec 2003 05:43 PST
Hi again? glad you wrote back, this question interests me as I'm doing
a great deal of work lately in this area on a few other projects. I'm
not sure what level of programming knowledge you are at, so if I
appear to be "talking below you" please understand that it is not
meant to mean anything except in the area of  "clarity".

Okay, you said 

-------
Purpose -- Instant creation of intelligent buttons, tabs, menu items,
and animated shapes for insertion and floating in new and existing
pages.

Buttons would also be inserted inside of swf files.

Can you recommend a way to implement 100% success during the editing /
conversion process?

Also, do you know of a way to insert this SVG parser into my flash
code? If I can get the actionscript affects and svg parsing, that
would be a nice first step:

------

If this is our final goal, then we are going about it in the wrong
fashion. I can do this, but it would not be to your project's benefit.

First, the library and functions, once completed, for each button, or
even the smallest graphic, would be included in the final file, adding
a huge overhead to these.

Second, created this way, each button and graphic, if it was possible
to save it in this manner, would have to "create" itself every time it
was loaded.

Third, ? it is not possible to save it this way, since ActionScript
cannot 'save' files. We could work around this, by creating a text
file of sometype, xml or something to load variables and tell the
basic flash component created for you to load the right SVG file for
conversion, but this just adds another level of overhead to the SWF,
and, more processing time.

Four, our button would not be "smart" as we could not save the desired
functionality in this manner, again, SWF can not change itself and
recompile. There is no work around for this, as SWF will not read an
external text actionscript library and use it. FLA's will do this in
the development stage, but once compiled, it will no longer be able to
do this. The file read would simply be added text.

Five: doing it this way, even if all the problems could be worked out,
limits our output files in size, shape and complexity.

And last but certainly not least in the problems of this approach is
fonts. Adding the right fonts to the "prototype" file would be messy
indeed, and a absolute monster in the size problem. Literally, even a
modest list of fonts added for the user to apply to their button,
would add almost two megs to the final SWF file, for every button or
graphic, whether the font is used or not.

I've done this, and the action script needed to import the SVG file
would be several times larger than the SVG file itself. What we would
have at the end is a very slow, very large, very clumsy SWF button. It
is a great pastime in the "gosh.. can I do this?" area, but that is
all it is.

What we want to do, if this is our goal, is this:

1.	Create an SVG file in a known and controlled format, with fonts and
size and colors.

2.	Get the desired "smart" action from the user (what ever it is, in
ActionScript language, the user wants the button to do, this could be
a set library with changeable variables).

3.	Parse, the SVG file, and set the actionscript for the SWF outside

4.	Create, import only the fonts we are really going to use, if any,
compile and save the SWF file for use on a website or, importing into
another SWF file created in a similar manner, or through the Flash
interface.

What we have now is a SWF file which does the desired actions, and has
only what is required to do it's job complied inside. Thus it is as
small, and fast as possible. Also, changing the Look, or Action of the
"smart" button or graphic is simple as well, creating a new file. You
would have now a method of creating libraries of swf's, or changing
the color scheme of existing swf's used on a website, simply by
changing a few hex codes and recompiling.

To do this we can use PHP, or Perl, or Python. I know and have a great
deal of experience with the PHP or Perl methods. We can also do this
in a Visual C++, but I personally would want to start with the Perl
method for a prototype, because the time is much less, and you could
work out any bugs or problems with the steps involved, before
committing the time required for the C++ version.

Our development overhead, is top heavy in the "drawing interface"
There is a reason the very talented people at ActionScript-Toolbox,
only did "one" graphic at a time on their demo there, with no color
changes or really anything else. It's a lot of work for a demo. Much
more than say, 8 or 10 hours.

What is a bit "ironic" is, the fastest method of developing an
interface to draw and design with, would be a Flash program, like is
seen on the http://www.eddiecat.us site. There is also a interface at
source forge I've been watching for some time now with a great deal of
interest.
http://drawswf.sourceforge.net/

It is in Java, but it does create and save SWF images, and uses SVG
files as it's 'save' file. It will also give you an idea of the size
and complexity required of a drawing interface to do this type of
work. *Side comment : of course the Warning, given by the Java
WebStart interface when it loads will scare the pants off any
potential user of this program as well. J (This Program is requesting
Unlimited Access to your Computer?) Ha! But it is a great work in
progress, and an example of some very talented people.

You said :

I would be satisfied to do this, and wonder if you can create an
action-script that can create an SWF movie that will parse any SVG
file that is equal or less than its size?

The "any" part is a bit scary there, as I'm very sure given enough
time I can do this, I can't do it under the existing budget, or time
frame. I can, parse and create SWF's from simple SVG's, and add to
those SWF's a few examples of dynamic ActionScript "smart" commands
with dynamic font loading. This I could do under the time frame (the
budget is a bit tight).

The drawing interface gives us the advantage (a huge advantage) of
controlling the type and style of SVG created. With this control in
place, we can be certain of several things, which we can be certain of
in no other fashion really. Again, almost every program I've looked at
which creates SVG files, does so in it's own little way, and a great
deal of them are not compatible with each other. So if a user
approached this tool I created with an SVG file they made in Corel or
Adobe, it is almost certain to not work correctly. It's a shame really
that the "S" in SVG is for "Scalable" rather than "Standard" but there
you have it.

The tools and technology however is definitely available and, really,
it is only a matter of putting them together in the proper rows. We
can create from SVG an SWF file, with button or movie clips, or
graphics. We can put movie clips inside movie clips, so the
limitations on "what" we can create on the fly is really unlimited. We
can add fonts dynamically, and even images in PNG, JPG or BMP format,
and alter ActionScript commands to these movie clips to load other
webpages, respond to javascripts, or talk to them on the webpage. And
we can set the final SWF file to load a set of directions externally
from an XML file or other text file for things like changing prices
and displayed help text, so that the owner of the website only needs
to change a text file to alter values in the SWF file. All of this,
and much more is possible. More than possible, it is being done, in
one form or another, by me, and several others out there on the
Internet. You idea here is simply another way of putting these
together, which is currently (as far as I know) not being done.

I took a little break here from this rather long and growing response.
I apologize for being so long winded, but as I said, this question and
questions like it are of growing interest to me. I've been playing
around with the newest version of DrawSWF (the java program I
mentioned above), and they have come a very long way. The interface is
still a bit clumsy, but they are certainly moving in the right
direction. What is really interesting me right now, and what drew me
away, is the SVG output they create. It is clean, set, and from what I
can see, more or less, predictable. I mean this in a programic sense.

The font list comes from the user's installed fonts, so this isn't
really good enough for what you are trying to do, but ?

And they have a function to load images into the SVG, which again,
isn't great, because we have no control over where this image is, on a
website but?

Other than those two things, the SVG is clean and "simple" ? I'm very
tempted to suggest I could create an SWF from this tool's output, with
"functionality" . The functionality of course is the only thing they
are missing (besides the fonts and graphics) to being a completed idea
of what you are looking for.

Well.. I think this is long enough and brought up way more than enough
things for you to think about, and get back to me on. Check out the
DrawSWF program, you can download the jar file to your computer and
run it there (if you have Java installed of course), and go over what
I suggested about the "way" you want to do this to meet your goal. The
DrawSWF project shows this very well, and if you check the sizes of
the SVG files, vrs the sizes of the exported SWF files, it shows it
even more. Add those two together and you get basically the size of
what a file from your orginianl concept would create (minus all the
nessesary fonts of course).Let me know the outcome at very least, as I
am very interested in what the question poses.

Thanks, 

webadept-ga
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy