A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Best practice - Site construction

  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    36

    Best practice - Site construction

    Have lrg portfolio site. Takes too long to download.

    Am thinking main swf should load other external swf's on demand to solve.

    Built main and have it loading external swf's. That's working.

    Question is how do I get back to main swf via a back button. Reload main? unload loaded swf and main will be there underneath? Not getting this part.

    The back button will be in an external swf, so how does it interact with main?

    Any advice on building large (file size wise) sites greatly appreciated. Thx!!

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429

  3. #3
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    Gaia will be a good place for you to start , but eventually , you will realize the limitations of having a swf loading architecture. The best practice is to take the flex approach , which treats the project as one continuous RIA flow. Its basically a gui MVC. By no means do you have to use flex. You can build applications for the web just using flash. The idea is to not have swf after after swf of stuff , but components , shared for run time , that you edit in a shared library. In your case, since it sounds like you have a lot of graphics , you would break out all of that and load it dynamically , on demand , not all up front. Trust me , I just finished a project with the latest Gaia AS3 framework , and being a long time flex developer , I ended up overriding 60 percent or so of the framework. As much time as it saves having swfaddress and swfwheel and all that set up , i spent more time , hacking the framework. Depending on what you are doing you will run into situations where data that you need will not be available via the Gaia.api at the time you need it , so you will either have to wait for it, or bypass it all together. Anyway , just food for thought.

  4. #4
    Member
    Join Date
    Sep 2006
    Posts
    36

    Thanks! One last thing Attack Rabbit.

    I have no idea what any of this stuff is you guys suggested but it does give me a place to start. Thank you!

    I have a lynda.com account. I should be looking for info on building "components", is that right? I haven't come across that in the CS4 training.

    Basically, I'm a designer, so my portfolio site has a lot of large graphics and animation (some video). I built it all in "scenes" in MX pro. Everything worked great except the download (Monster! Not even my Mom would wait for that!)

    So I was thinking, strip it all out into swf's and load on demand. But hear what you're saying, not ideal... Just not sure what's best practice in this situation. Hate to develop something hacky to fix something hacky!

    Thanks so much for your time and advice!!

  5. #5
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    I mean loading swf's is a fine way to start. Since you are primarily more concerned with the design , creating timeline based animations , and or scripted , in swfs will certainly help you break up that monster of a file. Using a framework like gaia will be perfect for your needs because it is only concerned with swfs and since all your data is in the swf , already , it would take minimal efforts to get a decent little app up and running. But when you talk about 'Best Practices' , the latter does not fall under it. At the very least you would want to abstract things out , to at least try to dynamically control some of your content. To give you a practical example, a photo gallery. You probably have one in your portfolio already , at least to some degree, but rather then have all those huge images in your library as one compiled swf , you would architect out an ImageViewer or PhotoViewer , as a component of your portfoilio , that is only concerned with the loading and unloading , displaying of images. This way you can create it , which in bytes is virtually nothing , and have it load the images , when and only when the end user wants to see them. A lot of developers will make the assumption that all content available will be seen , or will even want to be seen by the end user. This is a costly assumption. The best practice , is to let the user decide what he or she wants to see , and then have your application load it. Even this approach can still be used with sub swfs, that will work with gaia or a gaia like framework. But even one better , is to make the whole application dynamic , all in one swf like you have it , but tiny , couple 100k. Now there will be times when a sub swf might be the only way you can achieve something , usually there is always another way , but it could be that the better , other way , might just be so time intensive it will put your project out of scope.

    so its really up to you. I wouldn't search for anything on how to build components specifically. In your case , i would go to that gaia link posted earlier , and just slowly , and patiently read through the documentation. Check out some of example sites. Then download framework , its free , install it , and start playing around with it. See how it works. Maybe build a quick little sample site , with just some boring swfs loading in and out. If you decide you like the way it doing things , your next task will be porting over your existing stuff into seperate swf to be loaded into the framework.
    Last edited by AttackRabbit; 11-18-2009 at 09:37 PM.

  6. #6
    Member
    Join Date
    Sep 2006
    Posts
    36

    Thanks Attack Rabbit

    I think what you are describing is next in my Flash evolution for sure.

    I don't know that I need Gaia for this, although I will check it out for future. My 13 buttons calling up 13 swf's are now working (using the code below). I just need some code for the back button in the external swf's to take me back to the main and I'm all set. I've tried a dozen different things from reading other posts on Remove Child. Any suggestions? Thanks for all your time. Have a great Turkey day!

    //this code lives on 13 frame labels, calling to 13 swf's. But can't get the back btn in the external swf's to work.

    var swf1:MovieClip;
    var loader1:Loader = new Loader();

    var defaultSWF1:URLRequest = new URLRequest("scene1.swf");
    loader1.load(defaultSWF1);
    addChild(loader1);

  7. #7
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Quote Originally Posted by kkompan View Post
    Have lrg portfolio site. Takes too long to download.

    Am thinking main swf should load other external swf's on demand to solve.

    Built main and have it loading external swf's. That's working.

    Question is how do I get back to main swf via a back button. Reload main? unload loaded swf and main will be there underneath? Not getting this part.

    The back button will be in an external swf, so how does it interact with main?

    Any advice on building large (file size wise) sites greatly appreciated. Thx!!
    I am not using any of the frameworks, since i am probably a code junkey .

    My advice to you is to go through your whple movie first and look what you can convert. Many movieclips can probably be graphics. Then look at reusability of movieclips. If you have one separate button for each url can you not have just one button with an empty dynamic textfield and then create a class and you can reuse the button all the time. this kind of stuff you need to look at. And come back with specific questions.
    - The right of the People to create Flash movies shall not be infringed. -

Tags for this Thread

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