|
So I could to make an NSIS plug-in that support flash using this library.
|
|
|
|
|
Dear Darkoman,
First of all, thank you for your work on this awesome library.
I would like to know more about the CSWFButton class and how to use it, maybe an example?
Specifically how do I create a CSWFButton and apply a CSWFBitmap image to each state???
One more question, do you plan on releasing the SWFLIB update with text support?
Kind Regards
|
|
|
|
|
hi, darkman,
i test used swflib v1.1, it works fine in every aspect, except rotation.
the scaling(zooming) will affect rotation angle, here i paste the related code in your lib to make it clear:
void CSWFShape::Scale(float scaleX, float scaleY)//here, if you set a value for scaleX and SaleY
{ //it will change angle!!! what's the problem?
MATRIX_F matrix;
m_TransformationMatrix.GetMatrix(matrix);
matrix.scaleX = scaleX;
matrix.scaleY = scaleY;
m_TransformationMatrix.SetMatrix(matrix);
}
void CSWFShape::Rotate(float angle) //i set angle fixed to 30 !!!
{ //however, the resulting swf's angle
MATRIX_F matrix; //still could be affected by Scale value.
m_TransformationMatrix.GetMatrix(matrix);
if (((int)angle % 90) == 0)
angle += 0.05f;
double a = PI / 180;
matrix.scaleX = (float)cos(angle*a);
matrix.scaleY = (float)cos(angle*a);
matrix.rotateSkew0 = (float)sin(angle*a);
matrix.rotateSkew1 = -(float)sin(angle*a);
m_TransformationMatrix.SetMatrix(matrix);
}
Is there a way solving the problem? and how? thank you in advance.
|
|
|
|
|
// Movie Params
SIZE_F movie_size = {300.0f, 260.0f};
int framerate = 1;
POINT_F pt;
CSWFMovie m_SWFMovie;
// Create Basic Movie
m_SWFMovie.OpenSWFFile("SWFTest.swf", movie_size, framerate);
// Give it a background colour
SWF_RGB bgColor = {255, 0, 0};
m_SWFMovie.SetBackgroundColor(bgColor);
float bmp_width = 256.0f; float bmp_height = 256.0f;
// Define shapes
RECT_F shapeRect = {0.0f, 0.0f, 300.0f, 260.0f};
SWF_RGBA lineColor = {0, 0, 0, 255};
RECT_F bitmapRect = {0.0f, 0.0f, bmp_width, bmp_height}; // size of the bitmap
RECT_F clipRect = shapeRect; // fill the full rectangle
LPTSTR pFileName[4]={ "bm128.jpg", "bm130.jpg" ,"bm129.jpg" ,"bm131.jpg" };
static CSWFBitmap bmp[4]={ CSWFBitmap(1, (UCHAR*)(pFileName[0]) ) ,\
CSWFBitmap(2, (UCHAR*)(pFileName[1]) ),\
CSWFBitmap(3, (UCHAR*)"bm129.jpg" ), \
CSWFBitmap(4, (UCHAR*)(pFileName[3]) ) };
static CSWFShape shape[4]={ CSWFShape (3, shapeRect, 10), CSWFShape (4, shapeRect, 11), \
CSWFShape (5, shapeRect, 12), CSWFShape (6, shapeRect, 13) };
for(int i=0;i<4;i++)
{
// Define bitmap object
m_SWFMovie.DefineObject(&bmp[i], -1, false);
// Define the rectangle shape
shape[i].AddLineStyle(3, lineColor);
shape[i].AddBitmapFillStyle(bmp[i].m_ID, SWF_FILLSTYLETYPE_BITMAP_0, bitmapRect, clipRect);
pt.x = 0;
pt.y = 0;
shape[i].ChangeStyle(1, 1, 0, &pt);
//Draw out the rectangle
shape[i].AddLineSegment(300, 0);
shape[i].AddLineSegment(0, 260);
shape[i].AddLineSegment(-300, 0);
shape[i].AddLineSegment(0, -260);
m_SWFMovie.DefineObject(&shape[i], shape[i].m_Depth, true);
//m_SWFMovie.UpdateObject(&shape[i],i,NULL,-1);
// Update the frame
m_SWFMovie.ShowFrame();
}
// Close .SWF file
m_SWFMovie.CloseSWFFile();
the question as follow:
the third and fourth frame is not shown usually.
please help me to find the cause.
thanks for author help
modified on Thursday, November 5, 2009 2:04 AM
|
|
|
|
|
Hello,
please see the following lines in your code:
static CSWFBitmap bmp[4]={ CSWFBitmap(1, (UCHAR*)(pFileName[0]) ) ,\<br />
CSWFBitmap(2, (UCHAR*)(pFileName[1]) ),\<br />
CSWFBitmap(3, (UCHAR*)"bm129.jpg" ), \<br />
CSWFBitmap(4, (UCHAR*)(pFileName[3]) ) };<br />
static CSWFShape shape[4]={ CSWFShape (3, shapeRect, 10), CSWFShape (4, shapeRect, 11), \<br />
CSWFShape (5, shapeRect, 12), CSWFShape (6, shapeRect, 13) };
As you can see the CSWFBitmap bmp[4] array has last two members with ID's 3 nd 4, respectively.
The similar situation is with the CSWFShape shape[4] array which has the first and the second member with the ID's 3 nd 4, respectively.
This means that you have 4 objects defined with 2 only 2 unique ID's, which is invalid situation.
That is why you don't see the third and the fourth frame of your animation.
The shape[0] and shape[1] are created in place of bmp[2] and bmp[3].
Hope I could help you !!!
Best regards,
Darkoman
"Avaritia est radix omnium malorum..."
|
|
|
|
|
oh, i see , Id must be unique to CSWFBitmap and CSWFShape.
thanks for your help
best regards
rootlife
|
|
|
|
|
Hi,
Congrats for rocking application.
I am getting an error regarding conflicting of lib files while trying to build the Test application. I have ignored "LIBCD.lib" as required but still no results.
I am working with Vista with MS Visual Studio 2005.
Any help will be appriaciated.
Thanks,
Saj.
|
|
|
|
|
hello
I would want to know which version of visual studio is due to compile this project.Indeed i can't achieve to compile this with neither wisual studio 2005 nor visual studio 6.0. Thus in visual studio 2005 the function pow of math.h triggers an error because it is not overrided
thank you
|
|
|
|
|
Hi darkoman,
Do you known how to transcode flash type to other media type(such as avi,mpeg4...)
or do you have the spec for flash type?Can you kindly give me some instruction?
My eMail is:topyangs@hotmail.com.Hope to get your reply.
Thanks,
|
|
|
|
|
Hi,
Do you plan to add TEXT capability to the library?
|
|
|
|
|
Hello,
thanks for an interest...
I have added that but I am spending time on testing it.
Hope to finish it soon.
Best regards,
Darkoman
|
|
|
|
|
I'm keen to trying it out when you have it ready...
|
|
|
|
|
The following is my code.
It creates swf file and I see that it is big enough (1.7MB) so I assume it incluse all the frames, but I see only the first frame.
void exportToFlash(HWND hwnd)
{
CString Path, Path1;
// Set movie params
POINT_F pt;
int cx=screen_cx;
int cy=screen_cy;
SIZE_F movieSize = {cx, cy};
int frameRate = 40;
// Create empty .SWF file
CSWFMovie swfMovie;
Path=STRING LogPath;
Path.Replace(".isu",".swf");
char *path=addDataFolder(STRING Path,Path1);
swfMovie.OpenSWFFile(path, movieSize, frameRate);
path=addDataFolder("Data\\Temp.jpg",Path1);
SWF_RGB bgColor = {0xf, 0xf, 0xf};
swfMovie.SetBackgroundColor(bgColor);
float bmp_width = 800.0f; float bmp_height = 533.0f;
// Define shapes
RECT_F shapeRect = {0.0f, 0.0f, 200.0f, 120.0f};
SWF_RGBA lineColor = {0, 0, 0, 255};
RECT_F bitmapRect = {0.0f, 0.0f, bmp_width, bmp_height}; // size of the bitmap
//RECT_F clipRect = shapeRect; // fill the full rectangle
for (int i=0; i
|
|
|
|
|
Hello,
thanks for the interest...
The reason for thew error is the following:
- the ID for each object must be unique
Regards,
Darkoman
"Avaritia est radix omnium malorum..."
|
|
|
|
|
Thank for the SWFLib !
I want to add an action context(action script) to a sprite.
How can I add the action context?
Is it possible?
------
Welcome!
|
|
|
|
|
Hello...
Thanks for the interest in the SWFLIB project.
Unfortunately, the action script is not supported in this release.
Best regards,
Darkoman
|
|
|
|
|
Thanks for your reply...
SWFLIB is very good library.
I need to add action script to flash.
Have you any plan or program architecture on the action script?
And, can I know that?
---
Welcome!
|
|
|
|
|
Hello,
in order to add action script to this library you'll have to follow the official Macromedia (now Adobe) SWF File Format Specification. I have to little time now to implement this but I will prepare this update for the future releases. I am sorry, but I have no specific plan to add ActionScript support for now.
Best regards,
Darkoman
|
|
|
|
|
Thanks for your reply...
Is that possible to add the action script on the flash ver. 3.0 ?
---
Welcome!
|
|
|
|
|
Hello,
the ActionScript of the Flash version 3.0 is already supported. Please see the programmers manual for the details in the downloads section of this article. These actions can be applied to either button object, the sprite object or to the main movie object.
Best regards,
Darkoman
|
|
|
|
|
|
Hello,
Just to make it clear:
- SWFLIB in its current release supports flash version 3.0 action model (simple tag-action model)
- flash version 4.0 extends this approach to stack-based tag-action model
- only flash version 5.0 and above extends this functionality to "JavaScript like" action model.
I am not able to do the action model upgrade in the SWFLIB in close future (I work on other projects). I will however inform you when this update is ready. I am very sorry for this delay...
Best regards,
Darkoman
|
|
|
|
|
|
thanks for this work, I have 2 questions:
1. the PDF doc says support for v4 is forthcoming; any ETA? progress? status?
2. i want to put some flash animations i make, using your SWFlib, on my web page; would you like a credit? if so, what would you like? (e.g., link to this page? your name? etc.)
|
|
|
|
|
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
|
|
|
|
|