Jump to content
Search Community

Creating a reusable SWFLoader Class to add content to dynamically added container

Yossarian test
Moderator Tag

Recommended Posts

Hello all,

 

Was wondering if any one can see what the problem with this class is. What I'm trying to achieve is to load content into an empty container (_main.container in LoadSWF.as) that is instantiated from my main class (Main.as) where I can keep its position fluid. I'm just transitioning to Greensock but have a tight deadline to get this working so I'm kind of hoping someone can help spot what I'm doing wrong. After I get this resolved I should be smooth sailing.

 

Main Class - I want to load my external .swfs into a library object that is dynamically added here (var container)

DockMenu Class - Where my navigation takes places, I want to call LoadSWF from here.

LoadSWF Class - Reusable Loading class for swfs, my debugger is pointing to line 40

 

Any other areas that catch any of your eyes that could be improved or are incorrectly done let me know, the only way I can learn this stuff is by being shown I've found recently. Thanks in advance everyone, btw I don't think I'll ever use AS3 and Flash without Greensock again!

Link to comment
Share on other sites

Hi,

 

Sorry, I couldn't spot any errors, but then again looking at raw code in 3 different classes isn't really a great way of debugging.

 

If you can created a simplified fla that we can publish with only enough code to illustrate the issue than perhaps we will be able to better assist you.

Link to comment
Share on other sites

Hello Carl,
 
Thanks for taking a look! Sorry about the raw code, figured maybe it was something I was doing outside of just the SWFLoader/Greensock. Here is a simplified version that I created to try and match the setup of my actual project. It doesn't throw any errors as my other code does but doesn't seem to Load/Unload any of the content into the contentHolder in Main. Hope this helps better demonstrate my setup without all the clutter.
 
I didn't include com.greensock for file size, but I have it stored in the root directory...
 
sample->com->greensock->* in my sample project and actual project.
 
Also, not too sure the best way to share files through the forums as of now, but here is a Fast-Files link to the Sample.Fla.

 

Sample.Fla

 

*Edit*

I just realized Fast-Files is kind of shady when looking for the actual download of the file, there is a subtle and small 'Download Now' button below the horizontal ad-bar, sorry for the shady file link.

Link to comment
Share on other sites

thanks for the files and the warning about Fast-Files. You can post zipped files in the forums directly. If your file is too big, I recommend http://ge.tt very easy to use, no sign ups, and no shady ads that try to trick you into installing software.

 

It seems the main problem was that the swfs you were trying to load were completely blank and empty of any visual assets. 

 

Please test the attached files. sample_fixed_CC.zip

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...