View Full Version : Need some advise :: Can I create an swf from within an swf?

12-30-2003, 03:38 AM
I am trying to workout the best way to do this, any ideas are welcomed.

I need to build a flash program that enables the user to configure a combat scenario using a set of defined elements.

It will involve the selection of Swat team members and the configuration of their specific actions.

The user will then have to draw the path for that member and set the timing - and be able to preview the result. This will need to be repeated to get the team (<20) to work in time.

------ This is the part I need help with -------
They then will need to be able to publish the result as a separate swf file (or a better solution) - minus the configuration options - to be able to view the complete scenario independantly. The results must be accessible as separate files.

All suggestions are welcomed.

12-30-2003, 04:15 AM
Howdy... ;)

I don't know how you can do that, but you cannot create another SWF file from one SWF file as far as I know...

12-30-2003, 05:00 AM
not sure i understand exactly what you're trying to do but...
maybe you could have a generic swf that loads external variables dependent on what they input. Then you could have a server side script write this external config file instead of the actual .swf (which is not a viable solution as CyanBlue said)


12-30-2003, 05:14 AM
Yeah I thought of that, but how can I access them through separate executable/swf file names?

12-30-2003, 05:31 AM
You should give us some more detailed information so that we can fess up something... We still could fess up something but usually we hear something like 'Oh, thank you, but I should have mentioned this or that blah blah'... :(

12-30-2003, 05:47 AM
alright, here goes.

There is an application that a client of mine has developed in Visual Basic - Word and Power Point.

Through a selection box in the VB interface there are files that can be launched. Currently they are PowerPoint .ppt files which launch a window and visually demonstrate the swat strike scenarios. We all know how lame and limiting powerpoint presentations are. I have been asked to create "clip art" gif animation for the swat team characters. Of course when I was briefed I started thinking of the options available via Flash.

The way they were working is that the user configures the animation in PowerPoint using the clip art of the animated swat characters. They import a floor plan of the house/building that is going to be entered, the characters are to be animated via PowerPoints animation up to the doors and then through the house, A - la Swat team strike style.

I had in mind to render out different walking and action sequences through 3DS Max and importing them into flash to create a universal character that can be configured to do multiple tasks and be attached to a drawn path to animate along. The benefits are that character will be topographical and will be able to turn in the direction it has to move in. It also wont be looping constantly, as it could be coded to stop when it stops moving on the path.

I would like to create a simple interface that the user can import the floorplan into, add swat members, set the members actions, draw the animation path, set the timing and preview the strike. Ultimately the result needs to be individual strike files that go into the VB interface otpion box in place of the powerpoint file .ppt files and that launch when clicked to demonstrate the individual strikes.

Please let me know if you need anything else.:D

12-30-2003, 06:18 AM
Okay... This is what I think... (Basically I am reciting what splict mentioned...)

Just for arguments sake, let's say that you want to save a path on the floor plan and have your SWF animate along the given path...

Can you create a SWF that reads the path information from the text file and animate a soldier to go along that path???
When the strategy gets planned, you will pass the coordinates of the path to the VB and the VB will write a text file with the given information... and the SWF should read that coordinate and animate whatever is in the text file...

It won't be that hard thing to do, but I don't know how complex the data would be... But, yes, it can be done... ;)

12-30-2003, 07:18 AM
The animation and settings are not going to be defined in VB, they will be defined in a Flash movie.

Previously the complete animation would be done in PowerPoint, I just want to be able to replace PowerPoint with Flash.

I guess I could create a basic movie that has 2 parts, an edit mode and a present mode. The only problem I see is that there needs to be a facility to duplicate the file from an original and then rename it so it is accessible from the VB interface. That may be the VB programmers job.

12-30-2003, 07:27 AM
Well... How about this???

As you have stated, you can divide your Flash movie into two section... and if the text file exists and the variable in that text file, let's say 'mode', is set to 'edit' then you run the movie with the edit mode and the default should be the edit mode anyways, and if the 'mode' is set to 'view' then you run the movie with the present mode...

This way, you do not really need to duplicate another SWF file from the original movie... Don't you think??? (If you really have to make another one, you can just make a new file with present mode only...) and that should be the Flash develper's job, I think... ;)

Well... Gotta go get some sleep before the sun gets up high...
Keep it posted of what you find out... Love to hear more... ;)

12-30-2003, 07:31 AM
With the dual mode swf in mind. (the external text file variables is good - will run with it)

The problem is that the this swf will be deployed with the program and then it is up to the user to setup the strikes and present them. That is why it has to be within the program to duplicate the master swf and rename. Maybe this can be done in VB.

Thanks for you help.

12-30-2003, 07:32 AM
I tried to sell my services so that we do all the future scenarios for all the purchasers of the software, but they didn't go for it....

12-30-2003, 06:47 PM
Doh... :(

12-31-2003, 12:24 AM
I have tried to get the VB programmer to add the ability to copy and rename the swf through the interface.

If that is fine I will create an swf that has the 2 modes, one to edit, the other to play. The edit mode will write the text file and it will be recalled in the play mode.

I am scared at how complex this is going to be....

12-31-2003, 12:31 AM
Well... The routine itself wouldn't be that hard to make, but the amount of data you have to take care of would be fairly big... But I don't anything about how the structure is given, so I cannot really tell...

Anyways, good luck and keep it posted... ;)

12-31-2003, 03:37 AM
I will probably be back for help when I get to that point. ;)

12-31-2003, 11:05 AM
Good :)
I think it would be pretty interesting code to work on. Especially to get it optimised, like CyanBlue mentioned - could be a large bit of data.