Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-09-2003, 12:21 PM   #1
xmiinc
Registered User
 
Join Date: May 2003
Posts: 65
Default dynamically-load jpegs into scrollpane?

ActionScript Code:
this.attachMovie ("FScrollPaneSymbol", "scroller_sp", 11); scroller_sp. setSize (100, 300); swfThumbs=["tn_detective.jpg","tn_flower2.jpg","tn_trainPlatform.jpg"] this.createEmptyMovieClip("clipLoader",1); for(i=0;i< swfThumbs.length;i++){         clipLoader.createEmptyMovieClip("clip"+i+"_mc",i)         clipLoader.attachMovie("clip"+i+"_mc","clip"+i+"_mc",i);         clipLoader.loadMovieNum(swfThumbs[i],i); }/**/ scroller_sp.setScrollContent(clipLoader);
...the debugger shows clipLoader with the requisite attached clips, but I'm not sure whether the jpegs are actually being loaded, and nothing ever seems to show up in the scrollpane in any case. How do I take an array of jpeg names, load each in a _mc, and get each clip to display in scrollpane? This thing is kicking my ass and I thought components were supposed to make things easier <sigh>...what am I missing in scripting this? any help/hints greatly appreciated


[EDIT/CyanBlue]
Moved to the Flash MX And Lower - Flash MX ActionScript forum
Please state what your working environment is and
please post in the right forum
[/EDIT]

Last edited by CyanBlue; 10-05-2003 at 07:14 PM.
xmiinc is offline   Reply With Quote
Old 09-09-2003, 06:01 PM   #2
xmiinc
Registered User
 
Join Date: May 2003
Posts: 65
Default

please take a look and tell me what it is about using scrollpane that I'm not accounting for, or where my AS-ing is messed up. I get the general idea that for multiple jpeg's, they need to be "wrapped" in a _mc which in turn are "contained" in another _mc, which is then loaded into scrollpane.

thanks.

(Can anyone explain how the scrollpane component makes displaying other _mc's with a scrollbar *easier* than just coding something like it from scratch? I'm amazed at how byzantine this process is, in spite of using a pre-built component.)
xmiinc is offline   Reply With Quote
Old 09-10-2003, 12:53 PM   #3
xmiinc
Registered User
 
Join Date: May 2003
Posts: 65
Default

by the way, has anyone ever seen the "official" Macromedia tutorial on using Scrollpane? Its a ridiculously complex example that doesn't do much to explain the basics - and I'm not even including the the VB side of it! http://www.macromedia.com/devnet/mx/...les/part1.html

The usual sources have precious little about the thinking and structure behind scrollpane that might clue us first-timers into using it properly. For instance, I actually thought the component would handle spacing between images as part of its functionality! What little I've gleaned about this component makes me wonder how useful using it is over designing a custom solution. But perhaps the reluctance to respond to this thread is a sign that others also think its hardly worth the effort?? (It hasn't been lost on me that a fair number of threads have to do with Scrollpane idiosyncracies...)
xmiinc is offline   Reply With Quote
Old 09-10-2003, 02:59 PM   #4
xmiinc
Registered User
 
Join Date: May 2003
Posts: 65
Default

how is it that I can loadScrollContent():
ActionScript Code:
this.attachMovie ("FScrollPaneSymbol", "scroller_sp",11); swfThumbs=["tn_detective.jpg","tn_flower2.jpg","tn_trainPlatform.jpg"] scroller_sp.loadScrollContent(swfThumbs[1]) scroller_sp.refreshPane()

...but I cannot setScrollContent():
ActionScript Code:
this.attachMovie ("FScrollPaneSymbol", "scroller_sp",11); swfThumbs=["tn_detective.jpg","tn_flower2.jpg","tn_trainPlatform.jpg"] this.createEmptyMovieClip ("clipLoader",1); clipLoader.loadMovie(swfThumbs[1]) scroller_sp.setScrollContent(clipLoader) scroller_sp.refreshPane()

Last edited by xmiinc; 09-10-2003 at 03:02 PM.
xmiinc is offline   Reply With Quote
Old 09-10-2003, 04:04 PM   #5
flashdudette
He is Risen!
 
flashdudette's Avatar
 
Join Date: Mar 2002
Location: usa
Posts: 432
Default

you may find your answer here:
http://www.actionscript.org/forums/s...ght=scrollpane
__________________
------------------------
Call on the name of the Lord and you will be saved.
flashdudette is offline   Reply With Quote
Old 09-10-2003, 05:29 PM   #6
xmiinc
Registered User
 
Join Date: May 2003
Posts: 65
Default

thanks, I went through this thread (and others in this forum) a few days ago. I'll give it another look...maybe my perspective has changed. (something's got to, right?)
xmiinc is offline   Reply With Quote
Old 09-10-2003, 07:28 PM   #7
xmiinc
Registered User
 
Join Date: May 2003
Posts: 65
Default

This is ridiculous! Can I or can I not wrap a jpeg into a _mc on the fly and put that into a scrollpane?? Simple question. **Can it or can it not be done?** I've been dancing around with this for 2 days now, and I really want to avoid having to prepare swfs ahead of time whenever I have a new jpeg to display.
xmiinc is offline   Reply With Quote
Old 09-11-2003, 09:13 AM   #8
flashdudette
He is Risen!
 
flashdudette's Avatar
 
Join Date: Mar 2002
Location: usa
Posts: 432
Default

You could check the thumbnail gallery component at flashcomponent.net and look at his code to see how he did it. He uses xml to load the pictures. That's all I can think about. Often looking at how others do things suddently gives you the answer to the question you have. I hope this will.
__________________
------------------------
Call on the name of the Lord and you will be saved.
flashdudette is offline   Reply With Quote
Old 09-11-2003, 01:53 PM   #9
xmiinc
Registered User
 
Join Date: May 2003
Posts: 65
Default

before I start adding onto my problems by using another technology I don't have much experience with: XML, I would just love a response from this forum that tells me whether my approach has any prospect of succeeding. I've been doing nothing but looking at other people's approaches and tutorials on scrollpane usage (including yours). What is stunning is how, for an image display style that is fairly widespread across the internet, little information there is to enable it. Its really taken me by surprise. The tutorials have either the simplest implementation (a single large image bounded by scrollbars), or something much more complex, using VB, PHP, or XML. I'm just looking to load thumbnails in a row that, when clicked, can call a function. But I can't get the thumbnails to appear in the scrollpane. I can get multiple images to appear on stage without the scrollpane, but I can't seem to get those images to even appear (much less call functions!) within the scrollpane. My latest try, was wrapping each jpeg in a mc, with each mc a child of a "container" mc (with a bit of an x/y offset) that I expected to be able to place inside the scrollpane. I'm not sure whether the wrapped jpegs even need to be contained again in a holder, but this was my latest attempt.
ActionScript Code:
swfThumbs=["tn_detective.jpg","tn_flower2.jpg","tn_trainPlatform.jpg"] this.attachMovie ("FScrollPaneSymbol", "scroller_sp",0); scroller_sp.setSize (100, 300); createEmptyMovieClip ("clipLoader",1); var x=10; var y=10; var incr=30; for(i=0;i<swfThumbs.length;i++){     clipLoader.createEmptyMovieClip("jpgWrapper"+i,i);     clipLoader["jpgWrapper"+i].loadMovie(swfThumbs[i]);     clipLoader["jpgWrapper"+i]._x=x;     clipLoader["jpgWrapper"+i]._y=y;     y=y+incr; //  scroller_sp.getScrollContent() } scroller_sp.setScrollContent(clipLoader); scroller_sp.refreshPane();
The debugger has shown me what's happening, but it can't tell me what to do. And I don't know what to do because information on the idea behind scrollpane is, for all intents and purposes, nonexistent. In spite of all my books and researching, its still not clear what scrollpane actually needs to function under a given set of circumstances. I have functions to get, set, and load jpegs, swfs, and mc's. Distinctions are made between loading from the library or from the stage, or straight from a directory. But no context is given as to which methods are appropriate under which circumstances. I've been *working* this for days, not just sitting around waiting for help; breaking the problem down to simplest forms, and I'm still running around in circles. At one point, I *think* I was getting the last jpeg in the array to display using loadScrollContent(), but since a jpeg has no properties, I didn't consider that useful and in any case was unable to show multiple jpegs at a time. Once again, any help would be greatly appreciated.
xmiinc is offline   Reply With Quote
Old 09-11-2003, 02:08 PM   #10
flashdudette
He is Risen!
 
flashdudette's Avatar
 
Join Date: Mar 2002
Location: usa
Posts: 432
Default

add quotes to cliploader word in parenthesis. I am not sure it is the problem though. Let me know.
scroller_sp.setScrollContent("clipLoader");
__________________
------------------------
Call on the name of the Lord and you will be saved.
flashdudette is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:29 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.