|
Hello, thanks for your comments...
1. Yes, actually I have done some work but I didn't find an extra time to update an article and the library guide. You will for sure need an updated version of this SWF library (with no bugs), so I'll try to post it in the next few days.
2. The link to the site would be enough. Thank you very much...
Best regards,
Darkoman
|
|
|
|
|
fwiw, http://home.earthlink.net/~amacginitie
...don't expect anything fancy, though!
|
|
|
|
|
Hello,
I have seen your work.
It's more then fancy... I like it!
Thanks again for your interest for SWFLIB project.
Best regards,
Darkoman
|
|
|
|
|
Hi all,
If anyone has used this file to create a bitmap (jpeg) animation, maybe you can help me. I have two jpegs and I want to create a 2 frame animation. I follow the authors instructions and the first frame turns out correct (except for image is flipped).
However, in the second frame the bitmap is not updated. A second frame IS being produced because if I move the rectangle shape that shows up in the animation, but the image filling the rectangle remains the same. I have followed the authors instructions and order but I can't find where I'm going wrong. I've tried using the same shape, updating the shape, using arrays of bitmaps etc, but have been unable to have the 2nd image appear on the 2nd frame.
Any help would be appreciated.
Regards,
Stephen Faul
Here follows the code used....
SIZE_F movie_size = {200.0f, 120.0f};<br />
int framerate = 1;<br />
POINT_F pt;<br />
CSWFMovie m_SWFMovie;<br />
<br />
m_SWFMovie.OpenSWFFile("C:\\TEMP\\SWFTest.swf", movie_size, framerate);<br />
SWF_RGB bgColor = {255, 0, 0};<br />
m_SWFMovie.SetBackgroundColor(bgColor);<br />
<br />
float bmp_width = 800.0f; float bmp_height = 533.0f;<br />
<br />
RECT_F shapeRect = {0.0f, 0.0f, 200.0f, 120.0f};<br />
SWF_RGBA lineColor = {0, 0, 0, 255};<br />
RECT_F bitmapRect = {0.0f, 0.0f, bmp_width, bmp_height};
RECT_F clipRect = shapeRect;
<br />
<br />
<br />
<br />
CSWFBitmap bmp(1, "C:\\TEMP\\ron40002.jpg");<br />
m_SWFMovie.DefineObject(&bmp, -1, false);<br />
<br />
CSWFShape shape(3, shapeRect, 1);<br />
shape.AddLineStyle(3, lineColor);<br />
shape.AddBitmapFillStyle(bmp.m_ID, SWF_FILLSTYLETYPE_BITMAP_0, bitmapRect, clipRect);<br />
<br />
pt.x = 0;<br />
pt.y = 0;<br />
shape.ChangeStyle(1, 1, 0, &pt);<br />
<br />
shape.AddLineSegment(200, 0);<br />
shape.AddLineSegment(0, 120);<br />
shape.AddLineSegment(-200, 0);<br />
shape.AddLineSegment(0, -120);<br />
m_SWFMovie.DefineObject(&shape, shape.m_ID, true);<br />
<br />
m_SWFMovie.ShowFrame();<br />
<br />
<br />
<br />
<br />
<br />
CSWFBitmap bmp2(2, "C:\\TEMP\\ron40006.jpg");<br />
m_SWFMovie.DefineObject(&bmp2, -1, false);<br />
<br />
CSWFShape shape2(4, shapeRect, 1);<br />
shape.AddLineStyle(3, lineColor);<br />
shape.AddBitmapFillStyle(bmp2.m_ID, SWF_FILLSTYLETYPE_BITMAP_0, bitmapRect, clipRect);<br />
<br />
pt.x = 0;<br />
pt.y = 0;<br />
shape2.ChangeStyle(1, 1, 0, &pt);<br />
<br />
shape2.AddLineSegment(200, 0);<br />
shape2.AddLineSegment(0, 120);<br />
shape2.AddLineSegment(-200, 0);<br />
shape2.AddLineSegment(0, -120);<br />
m_SWFMovie.DefineObject(&shape2, shape2.m_ID, true);<br />
<br />
m_SWFMovie.ShowFrame();<br />
<br />
m_SWFMovie.CloseSWFFile();<br />
|
|
|
|
|
I also have this problem.
It maybe can't DefineObject for shape twice.
|
|
|
|
|
Hello,
The following lines are wrong:
// Define the rectangle shape
CSWFShape shape2(4, shapeRect, 1);
shape.AddLineStyle(3, lineColor);
shape.AddBitmapFillStyle(bmp2.m_ID, SWF_FILLSTYLETYPE_BITMAP_0, bitmapRect, clipRect);
should be:
// Define the rectangle shape
CSWFShape shape2(4, shapeRect, 1);
shape2.AddLineStyle(3, lineColor);
shape2.AddBitmapFillStyle(bmp2.m_ID, SWF_FILLSTYLETYPE_BITMAP_0, bitmapRect, clipRect);
Regards,
Darkoman
"Avaritia est radix omnium malorum..."
|
|
|
|
|
Overall very good work but docs lack some info on parameters, doxygen ?
I frequently have to debug test set digging in methods to understand details, getting SWF at hand. A key part to help doc, explain reference system. Otherwise anybody MUST read SWF doc before.
Ok I stop complaining, If I still look at it it's because it's pretty!
A Major issue for me, new version more difficult to handle than last one, already touchy.
If I try to use Scale() on a shape filled with a bitmap(not tryed on other kinds), strange comportement happens.
From 0 to nearly 1 I get a scaled pictured (ok), but anything over 1?0 give a small line on the edge (looks the shape outline) that scale inverted. A bits overflow ?
In testProject
void CSWFLIBTestProjectDlg::CreateSWFMovie_Bitmap()
..
Try replacing
swfMovie.DefineObject(&shape, shape.m_Depth, true);
swfMovie.ShowFrame();
By
swfMovie.DefineObject(&shape, shape.m_Depth, true);
shape.Scale(0.2f, 0.2f);
swfMovie.UpdateObject(&shape, shape.m_Depth, NULL, -1);
swfMovie.ShowFrame();
shape.Scale(0.5f, 0.5f);
swfMovie.UpdateObject(&shape, shape.m_Depth, NULL, -1);
swfMovie.ShowFrame();
shape.Scale(1.0f, 1.0f);
swfMovie.UpdateObject(&shape, shape.m_Depth, NULL, -1);
swfMovie.ShowFrame();
shape.Scale(2.0f, 2.0f);
swfMovie.UpdateObject(&shape, shape.m_Depth, NULL, -1);
swfMovie.ShowFrame();
And run it. (better reduce frame rate to 2!), only the first 2 "Scale" will do something sensible, why ?
A)
- What's wrong with this code ?
- Is Scale() limited ? (doesn't look when digging first level of the code) or a wrap up when converting from 16.16 ?
B) Why is ratio = -1 (I guessed because it's of no use if not between 2 morphedshape) ?
c) Sample in reference need some adpation to care about default value looks like there was previous verson with default in def. right ? wrong ? (ratio is one of them)
Anyway many thanks.
Gordon
|
|
|
|
|
Hello and thank you very much for your interest in SWFLIB.
The SWFLIB project is in its early development state so I am not supprized the many new bugs come out as users try to use it in their solutions.
Therefore, I will ask you for a patience until a new version is released and all known bugs are repaired.
Right now, I am finishing a text support in SWFLIB.
Best regards,
Darko
|
|
|
|
|
in void CSWFMatrix::SetMatrix(MATRIX_F matrix)
To get number of bits needed to encode value you use
while (pow(2, rotateSkewBitsNeaded) < maxValue)<br />
rotateSkewBitsNeaded++;<br />
rotateSkewBitsNeaded += 17;
But it does a implicit casting to compare a double with and int and doesn't always give enough bits
may work with <=,
Theoretically the direct math give
scaleBitsNeaded = (u_int)ceil(log10((double)maxValue)/log10(2))
It did worked too but I suspect that it take a lot more CPU time to get it than a while loop (and avoid caring about rounding)
So I change it to final
while ((0x1 << scaleBitsNeaded) <= maxValue) {<br />
scaleBitsNeaded++;<br />
}<br />
scaleBitsNeaded += 17;
Sucessfully for scale between 1.0 and 2.0 (failed previously) and even faster than the double pow().
and extend that to others bits sizing.
Looks good to me and better be part of the code, or do I miss something ?
Gordon
|
|
|
|
|
Just like follow as:
....<br />
CSWFBitmap *bitmap[2];<br />
bitmap[0]=new CSWFBitmap(10, (UCHAR*)"bm128.jpg");<br />
bitmap[1]=new CSWFBitmap(11, (UCHAR*)"1.jpg");<br />
<br />
swfMovie.DefineObject(bitmap[0],10, false);<br />
swfMovie.DefineObject(bitmap[1],11,false);<br />
CSWFShape *shapex[2];<br />
shapex[0]=new CSWFShape(20,shapeRect,20);<br />
shapex[1]=new CSWFShape(21,shapeRect,21);<br />
for (int i=0;i<2;i++)<br />
{<br />
shapex[i]->AddLineStyle(3, lineColor);<br />
shapex[i]->AddBitmapFillStyle(bitmap[i]->m_ID, SWF_FILLSTYLETYPE_BITMAP_0, bitmapRect, clipRect); <br />
swfMovie.DefineObject(shapex[i], shapex[i]->m_Depth,true); <br />
shapex[i]->Translate(i*200,100);<br />
swfMovie.UpdateObject(shapex[i],i,NULL,-1); <br />
swfMovie.ShowFrame();<br />
}<br />
....<br />
It can't work correctly.And the movie is blank.
My aim is show 2 jpeg in the movies.but i was failed in evidence~~~
How to do??
No pain no gain!
|
|
|
|
|
Hello...
1. When you define the CSWFBitmap object there is no need to define its depth value in the DefineObject() method call.
2. Before you do any shape definition (like in the loop) you'll have to DRAW your shape object line by line (or curve by curve). I don't see that in your code. If it is, ie. a rectangle, then just draw the rectangle with four basic calls of AddLineSegment() method.
Other things should be OK but you could have a flickering of the second bitmap object since you add it in the second keyframe.
Best regards...
|
|
|
|
|
Please check the code for type probelms.
For instance
int maxValue = __max(abs(m_SWFMatrix.TranslateX), abs(m_SWFMatrix.TranslateY));
You are asking for the abs of an unsigned value.
|
|
|
|
|
Why do you feel that your package is better than some of the open source sdk's on the web? They are almost up to Flash v7 features. I would have thought that it would be better to concentrate efforts in one direction, but maybe I am missing the benefits of your code.
|
|
|
|
|
Hello,
I would hardly call this work "reinventing the wheel". The main SWF SDK tools can be found on the SourceForge.Net with different support for generating SWF movies (with different interfaces, platforms, versions etc.), but there are no articles on this topic on the CodeProject.
I said in the article text: this is an EXPERIMENTAL WORK (not the FINAL WORK). It is made to be easy-to-use and understand.
I have seen the work of Macromedia team (SWF SDK version 4 from the year 2000.) and it is not an easy-to-use library. Have you seen it?
I am not going to chase the latest flash format version (now specification for Flash file format 8.0 is available for download), but to build a stable library primarly designed for flash animation.
I don't feel my work is better, I think it is usefull...
Best regards...
|
|
|
|
|
No criticism here, indeed, I think it's very interesting. I was just trying to get an idea of how it sits in comparison to some of the other tools around such as Red5, haXe etc.
Thankyou for the code. I shall look at it further.
|
|
|
|
|
I have no intention of starting a flame war, but I suggest you to read the articles you comment about before doing so.
darkoman never claims his work is "better" than any other. And by my experience with ActionScript programming I agree with him that Macromedia's documentation is far from friendly and/or complete.
Programmers that do the effort and use their time in showing others hoy to make things happen deserve our respect and gratitude.
And as far as I know, the spirit of this site is to have a place where programmers show to programmers ways of doing tasks, and I think darkoman is doing exactly that.
And last... well... saying that reinventing the wheel is a waste could be misleading, bacause the wheel has been reinvented several thousands of times since it's "first release". Ask Micheline if you don't trust this
Cheers,
HG
|
|
|
|
|
Thanks HG
Sorry...again....no criticism here. I have come back to Flash after a few years away and my head is full of all the ways that people are developing it. It all seems much more exciting than trying to write Actionscript in a tiny window in the Flash environment back then. All I was trying to do here was understand the benfits of using Michelin over Bridgestone on a particular track. I've written loads of code, some useful, some thrown away. Recently, I've got more into OpenSource and collaboration, so that's the angle I was coming from. I was trying to see where the fit was with other software.
Thanks for the crit tho'. I shall check my phrasing before jumping in too quickly next time.
Regards
ianM
www.happytuesdays.co.uk
|
|
|
|
|
I see that I incurred in the same error
You already had corrected your initial comment, so I apologize for flaming your first comment before reading all the thread.
By the way, I see you are in the multimedia arena and also in the open source too... have you seen irrlicht, ode, ogre, etc.? May be you could use some of the posibilities that those engines can do in the simulation field.
Greetings,
HG
|
|
|
|
|
Thanks for the links. I hadn't seen irrlicht.
ianM
www.happytuesdays.co.uk
|
|
|
|
|
I discovered irrlicht searching for 3d stuff a year ago, and I think it is a very well structured C++ 3d engine.
I've done some very interesting experiments with it.
Hope you can find it useful.
Cheers,
HG
|
|
|
|
|
Thank you for that library, it works well !
In my opinion, the documentation is too succint, and it could be interesting if you can do some other samples, maybe specialized on several points (morphing, bitmaps, etc).
Do you plan for a forum or samples in the website ?
Thierry
ps : please excuse my bad english, i'm french
|
|
|
|
|
Hello, yes I plan a detail revision of this library in the next release so I will provide more samples in the included Programmers manual.
Best regards,
PS.
If you think the submited documentation is too succinct you should see the original Flash File Format Specification for SWF version 8, released by Macromedia.
|
|
|
|
|
a few swf file don't play using it.
|
|
|
|
|
Hello,
can you submit to me the source code from which you try to play the .SWF file.
Thanks...
|
|
|
|
|
|