A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: What's the best way to do this?

  1. #1
    Junior Member
    Join Date
    Dec 2001
    Posts
    28

    What's the best way to do this?

    I am new to Flash after using Swish 2.0 and Max for years.

    I am trying to rebuild the following animation in Flash CS3 (2nd animation) that was originally build in Swish 2.0 (1st animation): http://www.sansom.net/combranteam.html

    The part I'm having trouble with is the profile for each of the team members.
    Each time you click on a photo, it launches the appropriate profile.
    1. In Swish, I used a Sprite (movie) and copied it then changed the photo and text for each person (easy, easy, easy)!

    2. In Flash, first, I built the Michael Jones profile as a Movie Clip Symbol (detailMichael) with nested Movie Clip and Graphic Symbols (photo, line, and text). I planned to make instances of that movie clip and change the photo and related text. However, I cannot seem to edit that part without having to opent the parent symbol that the other instances are derived from and change it. I know I can change Movie Clip instances but the changes seem to be very, very limited.

    I thought about making a separate SWF file for each team member profile then loading them on demand, but that seems too cumbersome.

    Surely, there is a better, more efficient way to create each profile without having to create them from scratch and duplicate all the layers/keyframes, etc.

    It would be ideal if I could make instances that could reference the parent and accept global changes.

    Thanks for any suggestions.

  2. #2
    _global.chosenson="flash"; chosenson's Avatar
    Join Date
    Jul 2002
    Location
    BIG APPLE
    Posts
    716
    Why not build the MC as you have, but instead of placing pictures, text, ... in it, load them dynamically. This way you can use an instance of the clip, and through actionscript, load the pictures, text, .... as needed.
    If you have a question, need some help, email me:chosenson

    It's always the simplest things that escape the complex mind!

    always be just

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Posts
    28
    Forgive my ignorance. Does that mean that the files will be separate and that I will have to upload the files and text to the server in addition to the SWF file?

    ks

  4. #4
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    You won't have to necessarily upload the pictures but yes, you could upload the pictures. There aren't that many though, so it wouldn't be that big a deal. And no with the text at all, you could store that in an array in flash. People build things in flash to be very easily editable, not necissarily easily built. Loading files externally with xml and writing the text in there too would really be the best way to go. That makes changes very simple for anyone with 1 hr. of training could do. you can do as chosenson suggested and put the files in the library and give them linkage identifiers and load them into the empty movie clips nested inside you 1 main clip that you've duplicated. And accompany that with the text stored in an array. This wouldn't be hard at all.

    Build 1 empty clip, and inside of it put an empty movie clip with the reg point in the top left of where the picture will be, then place empty dynamic text fields in the places you want text. Remember to embed your font in the fields. Give the picture clip an instance of pic, and the text fields instances like text1 text2 text3....

    Then you could duplicate that clip as many time you need and attach the pics inside. Give your main empty clip an instance of holder1. And give the others names like holder2 holder3 and so on. Give your pictures in the library linkage identifiers of pic1, pic2, pic3. Right click on the picture and hit properties to do that.

    Then use attachMovie

    holder1.pic.attachMovie("pic1");

    go further with this and use a for loop

    for(i=1; i<=(numOfPictures); i++){
    _root["holder"+i].pic.attachMovie("pic"+i);
    }

    I'm not sure but if you're using AS3 attachMovie may not work, and the _root might not be necessary because I believe it's bracket syntax.

    in which case I'm not sure of the syntax but I imagine its more like:

    for(i=1; i<=(numOfPictures); i++){
    ["holder"+i][pic]attachMovie("pic"+i);
    }

    Don't take my word on that, I've only purused AS3 for about 30 minutes and couldn't get anything to work(well not really anything).
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  5. #5
    _global.chosenson="flash"; chosenson's Avatar
    Join Date
    Jul 2002
    Location
    BIG APPLE
    Posts
    716
    Take a look at this site; http://chosenson.110mb.com/msk/MSK.html

    Look at the gallery. (I can't take credit for the site, only the gallery.)

    This gallery has very few objects in it. Only 1 of each necessary. 1 clip for the thumbnails with a dynamic text box for the preload counter below it. 1 clip for the large pics with a dynamic text box for the preload counter below it. There is also 1 dynamic textbox for the descriptions. A single button with a dynamic textbox for the navigation, and a few clips used as masks.

    The whole of the gallery is maintained as it's own swf file imported into the main site. The gallery imports everything at runtime.
    The XML file holds the picture desctiprions, pic names, navigation descriptions. This is all.
    It tells the movie how many galleries and how many pictures there are and where to find them without any extra code.
    The scripting reads the xml file, sees the file has 'x' gallery names and 'y' picture desciptions.
    The galleries are held in folders which are descriptively named; "Cars".
    The xml description for each gallery is the folder name which contains the pics and the thumbnail folder.
    The script will generate, dynamically, navigation buttons for each gallery it reads, thumb holders for each picture description, and one pic holder when a picture is viewed.

    At anytime the gallery can be changed just by changing the xml file with a text editor and uploading any new pictures.

    The whole gallery movie has about 120 lines of code. Not much.

    The gallery swf file is only 230 kb, which keeps loadtimes down.
    If you have a question, need some help, email me:chosenson

    It's always the simplest things that escape the complex mind!

    always be just

  6. #6
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    There is a video at:
    http://www.gotoandlearn.com/download.php

    It's called:
    Flash XML Basics

    That will show you an easy, effective way to use xml with flash for image galleries. There are other tuts there too that would help you:

    *You might want to have a preloader while the pics load up
    Basic Flash Preloader
    Advanced Flash Preloader

    The carousel tutorials (3 of them) might also be of some assistance. It isn't what you're looking to do but will show you how to get creative with xml and still keep it simple.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center