PDA

View Full Version : Scrollpane component questions


mike_mccue
12-23-2004, 06:58 PM
Hi
I have built a home page with a INFO button that opens a slide out window. The slide out contains a "ScrollPane" component that calls a seperate .swf file to display inside the scroll box area.

I think I am having trouble because I have not coded any checks for the swf that is too load.

On a Broadband connection the swf loads very quickly and it displays correctly.

On a dial up the window opens and displays the ScrollPane area BEFORE the contents .swf loads. The result is that the contents display OVER the ScrollPane and extend beyond the edge of main movie. The scrolling doesn't function and it looks awful.

If I refresh the page. It works well as the .swf is now in cache. The problem only shows up when you initially arrive at the page.

I know I need to add some code but I do not know where.

I would like to check for the contents AFTER THE INFO BUTTON IS CLICKED because I would like to have several instances of this kind of function and I would like to avoid loading all the content in the background if its not desired by the viewer.

You can see the page and try the INFO button in question here:

www.harmoniccycle.com (http://www.harmoniccycle.com)

In the hopes that someone will look at my file and suggest the layer and frame to place the neccesary code I have uploaded a stripped down and zipped .fla file with the extra .swf to be loaded here (118k):

zip of homepage and ScrollPane contents (http://www.harmoniccycle.com/hc/zip/skySCROLL_2.zip)

Thank you for any help or info you can provide,

mike mccue

palacajoe
12-23-2004, 07:28 PM
Add a load event to your scrollpane that call refreshPane()

3brand
12-23-2004, 08:12 PM
Or you could put a preloader in the SWF you load into the scrollpane.

mike_mccue
12-23-2004, 08:17 PM
Thanks very much for the suggestions. Can you elaborate. I am barely capable of coding and come from a graphics background. I am pushing my limits trying to learn the coding half of flash and need a bit more explanation to keep moving forward.

thanks,
mike

3brand
12-23-2004, 10:18 PM
Look in the tutorials, making preloaders is pretty easy, nothing too coding intensive.

mike_mccue
12-24-2004, 01:19 AM
Ok Thanks,
I can make a preloader but I am lost on where to put it.... thats my real problem... where is the place to do the check?

I usually use the preloaders on big files like video. The other thing is that in this case the primary problem is the sizing and the fact that the loading .swf file has larger pixel dimensions that the scrollpane display area.

I think part of my confusion is that it already has a Listener attached as per the ScrollPane help files.

If it is at all possible could you download my zip file and see what I have set up and offer a specific suggestion? I stripped all the non-pertinent info in an effort to make it more accomodating.

mike

3brand
12-24-2004, 08:37 PM
Alright, I was looking at the file and with the current way you have it setup you can easily add a preloader. I'm assuming you're trying to preload news_01a.swf, so you look in the tutorials section, grab a preloader script, images (or make your own), put it into the first frame of the movie. Have the rest of the movie on a later frame and in the script you can specify what frame you want it to jump to when its done loading.

I noticed that you're using a SWF file to store your news information. I suggest writing all your news in a .txt file and have the scroll pane load that (a little more scripting (like 3 lines) which can be found in the tutorial section as well). This way, you won't really ahve to preload it unless you write an insane amount of data. Also, news_01a.swf is 1200px long, you probably did that so you'd have room in the future for more text. Scrollpane's adjust dynamically (I'm pretty sure at least) to text files no matter what length so you won't need that extra white space towards the bottom.

I'm not sure how clear I'm being right now so if you have any problems I'll try to help you further (although I'm far from knowing a lot about actionscript and flash).

mike_mccue
12-26-2004, 02:58 PM
Thank you for looking at the files.

I am using a .swf file rather than dynamic text because I look forward to including graphic elements in the contents. I would have proceeded with that but still have the unresolved issue of the contents loading on top of the scrollpane display area. I appreciate your observation that the text would better serve the use as it is set up now. You are right about the 1200 pix being there for future use. I just added the text you see as a placeholder for the final content.

I wasn't sure which movie you suggested putting a preloader so I added a preloader to the news_01a.swf. It was functioning properly as a freestanding file but it did not accomplish the goal when integrated with the main movie. It just did its preload thing over the scrollpane display area and then loaded the text over the pane as well. Same exact problem just with a preloader at the head :-(

Can I add a preloader to the "INFO" button to watch for the loading news_01a.swf movie?

thanks again and happy holidays,
mike

mike_mccue
12-26-2004, 04:32 PM
I think I may have finally had an insight as to what is happening:

This whole time I have been looking for a mistake or loading solution but now I think i see what is happening.

The scrollpane components stock listener is coded like this:

scrollListener = new Object();
scrollListener.scroll = function (evt){
txtPosition.text = scrollbar01.newsframe.vPosition;
}
scrollbar01.newsframe.addEventListener("scroll", scrollListener);
completeListener = new Object;
completeListener.complete = function() {
trace("news_01a.swf has completed loading.");
}
scrollbar01.newsframe.addEventListener("complete", completeListener);



I had been approaching this as a htm person... figuring that the line

trace("news_01a.swf has completed loading.");

required the news_01a.swf to be placed in the same directory as the index page. And it is.
BUT, if I am interpreting the symptons correctly the links embedded in a .swf file are handled slightly different in flashplayer than in a html browser and the listener expects to find the news_01.swf imediately adjacent to the actual index file on display... that is, in the browsers cache. That is why it always loads incorrectly on a dial-up BUT then after a refresh works fine. Once the index .swf can find the news_01a.swf in the expected "directory" (in cache) it loads properly. Apparently it loads so quickly on broadband that the problem does not occur.

Maybe I am crazy... but this is my latest theory :-).

Now, what is the solution to get the functionality I am working towards?
I still haven't figured that out.

mike

mike_mccue
12-26-2004, 04:54 PM
So I just tried editing this line:

trace("news_01a.swf has completed loading.");

to this

trace("http://www.harmoniccycle.com/news_01a.swf has completed loading.");

but it doesn't seem to make any difference.

mike

3brand
12-26-2004, 08:30 PM
First off, using trace() displays anything within " " and variables in the debugger. So if you have " " around anything it'll just display the text, no images.

Secondly, using the dynamic text area can display HTML with the option turned on so you can display images using the normal img src tag.

Finally, news01_a.swf can have a preloader in the first 2 frames of the movie. After the first 2 frames you can put all your other content. All the preloader does is stop the movie before it gets any further and it waits until the user has recieved all the bytes of data. Look around for a preloader tutorial to put in the first 2 frames (most are only 2 frames, not sure about all of them) of your movie.

mike_mccue
12-26-2004, 09:04 PM
The dynamic text with the htm display may be just what I need. But i sure would like to figure out why this isn't working. I am hoping to have a flyout for a music jukebox and another for video presentation in the final home page design

I put preloader on frame 1 of news_01a.swf and it worked fine. BUT the preloader ran and the whole news_01a.swf still displayed OVER the ScrollPane display area. As I said as soon as I refresh it works just fine.

If you can look in my main flash file you will see that the movieclip named scrollbarFLYout (instance name: scrollBARindex) animates the scrollBAR mc so that it slides out. The ScrollPane component instance (newsframe) is in the ScrollBAR movie clip.

I am thinking that I need to place some kind of loader in the scrollbarFLYout movie clip so that it does not fly out until the news_01a.swf is available locally.

Does this sound feasible? Can you suggest how I can do this?

thanks very much for your continued suggestions,
mike

mike_mccue
12-26-2004, 09:26 PM
I found this in the help files under ScrollPane class:

__________________________________________________ ___

Method summary for the ScrollPane class
The following table lists methods of the ScrollPane class.

Method
Description

ScrollPane.getBytesLoaded()
Returns the number of bytes of content loaded.

ScrollPane.getBytesTotal()
Returns the total number of bytes of content to be loaded.

ScrollPane.refreshPane()
Reloads the contents of the scroll pane.

________________________________________________

But I am pretty clueless about how where to make use of this code :-(

I don't know if you add it to the code from the ScrollPane component help file as I used... and is shown in above message... or if you would use it with apreloader as I was suggesting in my last message.

Any tips?

thanks,
mike

mike_mccue
12-29-2004, 02:52 PM
I surfed the last few days and have found about a dozen cases of this exact same problem... all of them unresolved.

Is there anyone who can tell me what needs to be done?

I can't leave this on my page knowing a viewers first impression will be bad. :-(

It looks great on fast connections but its got to look right for everyone.

thanks,
mike