Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy And Paste? 1

Status
Not open for further replies.

Goat23

Technical User
Jul 22, 2001
61
US
I'm currently making a web site completely out of Flash. I have bands join and give them a page to advertise their music on. I have like 60 bands. Here's my problem: I got to make 60 flash pages that are set up the same (but with different information on them). Is there any way to copy and paste the layers (and information in them) so I can use them in seperate movies? Help would be greatly appreciated!
 
There are different copy and paste options you could use under the Edit menu ("copy frames" etc.) but I think there's an even easier way to do what you want (if I understand you correctly).

Take all the elements that your pages will have in common (I'm assuming, graphics and your logo and all that stuff) and put them on a layer (or several layers if necessary). Lock this layer so that you can't move it accidentally (the padlock icon in the timeline). Put a stop(); action in frame one. Add as many frames as you need for all the bands you have, this layer will give each frame a unified look without any cutting and pasting.

For the information that changes try this...

On the layer above the ones that are static add dynamic text boxes in the places you want to put band information, set them to the sizes you want, fonts, colours etc. Once these boxes are placed put a keyframe in for every band: in other words you'll have 60 plus keyframes on this layer which all have empty boxes in the same place. This means you can fill in the bands' information in each individual frame and it won't "leak" into the other frames but everything will have a consistent look. Give each frame a frame label with the band name in it (even better, set up another layer for the labels). Now you will be able to jump straight to a band's "page" by using...

gotoAndStop("bandname");

Add any other layers you need for the bands' logos or photos - these can be consistently placed by using the guides that you can pull out from the side of the screen when the stage rulers are switched on (ctrl+alt+shift+R).

This is a shortcut solution but it should give you what you want initially. If you're going to develop this as a business or whatever it would pay to have all the bands in a database and use ASP to talk to Flash and build new pages on the fly (not as hard as you might imagine).

 
wangbar that helped a lot, I just got Flash a couple months ago and am slightly familiar with programming. Could you explain how to do the database and using ASP. DO you do this through Flash, or through another program (such as a database program)? I'm going to have a lot more bands signing up in the future as I start to advertise and whatnot. So the more effecient process I have to setting up the bands pages the better it'll run, look, and most important how much time it'll consume.

I did try to do kinda what you said in the beginning. However, I got in big trouble as I was using the same frame for the bands. Also on each page I'm going to have three of the bands best songs in mp3 format that users can download. Is that going to create a problem with the database work? Thanks for the help, that's all for now.
 
The database and ASP stuff isn't too bad although it does take a lot more work than straight Flash. Basically what happens is that you have your normal Flash movie but you're sending and receiving data to and from a serverside data store. I've used Microsoft Access in the past because it's cheap and easy to use (if you've got Office you've already got it, if not things like mySQL are a good bet). ASP scripts (usually written in VBScript, sometimes JavaScript) act as a kind of bridge between your Flash front end on the user's machine and the database on the server. Your movie outputs variables (using loadVariables(); typically although getURL(); can be useful too) to the Active Server Page, this runs a script which formats everything for the database and then using SQL commands inserts the data you've sent into the database. The reverse also applies - ASP reads values from the DB, converts them into a Flash acceptable format and they appear as variables in your movie (also by using loadVariables();).

There are a ton of good ASP resources on the web giving you all the scripts you need to set up this data transfer and linking to Flash is a matter of one line of ActionScript (okay it's not quite that easy but you know what I mean :) ).

The MP3 files wouldn't necessarily cause a problem, although you can't store them directly in a DB (think text and numbers only for now) you could use the Flash Sound() object and a database-stored link to play the file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top