To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash MX

Reply
 
Thread Tools Search this Thread Display Modes
Old 02-01-2006, 06:29 PM   #1
Rancor
Member
 
Join Date: Apr 2004
Location: IA, USA
Posts: 57
Shared Library Problem (Library file loads twice)

What I'm trying to do:
Share a button in one Flash file for use in an imported Flash file.

The problem:
My first Flash file is loaded twice for some reason: once for the initial load, and again when the second, imported file calls on the shared library items.

The players:
FLA/SWF - <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span> (104k)
FLA/SWF - <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> (54k)
SWF - <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">loading</span> (5k, preloader)
BT - <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-button</span>, with MC <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-ani</span> inside the button

The details:
The preloader, <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">loading</span> loads 104k worth of data, all of <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span> shows up. It is sharing a button (see below) in its library, <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-button</span>.
Within <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span>, <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> then loads. The preloader loads 54k worth of data, the entirety of <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span>.

Here's where the problem occurs:
<span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> has loaded correctly; the preloader is in the first frame, so we know this to be true.
<span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> is completely loaded; the file is 54k, and 54k are shown to be loaded as seen in the preloader.
However, after loading, when <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> is to go to Frame 2, it chokes. It takes twice as long as <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> to load (therefore roughly 108k), before Frame 2 shows up.
After about 20 seconds on a 56k modem, everthing shows up and procedes normally, happily ever after.

What I'm pretty sure is causing the problem:
When <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> goes to display the shared button on Frame 2, I'm pretty sure it's loading <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span> again (104k), in order to get access to its shared library. (Even when I delete the large image so <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> is only mere bytes, it still acts like its loading about 104k.) This is obviously no good.

Therefore, the million-dollar question is:
Why is my shared library loading twice, when it's shared? In other words: How can I share the library items in <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span> so that they can be used in <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span> without loading the first file all over again?

Symbol linkage:
<span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-button</span> in <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span>:
[x]Export for runtime sharing
[x]Export in first frame
URL: tour.swf

<span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-ani</span> in <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span> (<span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-ani</span> is an animation that plays when the user rolls over <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-button</span>):
[x]Export for runtime sharing
[x]Export in first frame
URL: tour.swf

<span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-button</span> in <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">main-entrance</span>:
[x]Import for runtime sharing
URL: tour.swf

<span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">travel-ani</span> in <span style="font-family:'bitstream vera sans mono', 'courier new', courier, fixedsys; background-color:#ccc;">tour</span>:
[x]Import for runtime sharing
URL: tour.swf
Rancor is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash MX

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:37 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.