Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / August 2008



Tip: Looking for answers? Try searching our database.

Need help scrolling dynamic content from XML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
antonioStarms - 09 Aug 2008 18:39 GMT
I am trying to make a photo gallery and I have succeed in importing the
pictures from XML into Flash. There are still two problems:

1. The content is loading into a movieclip and I tried to place a scroll pane
on the stage to adding scrolling capabilities. I set the parameters to control
the movieclip that holds the thumbnails but it is not making a scroll bar. I
can see the pictures inside of the scroll pane but it will not scroll to show
the rest of the pictures.

2. I can not figure out how to space the thumbnails evenly. I made a variable
and multiplied the x position of each picture by it but there are large
differences between landscape and portrait pictures.

Thanks for the help

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("events.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
    spacing = 70;
    for (i=0; i<numimages; i++) {
        this.picHolder = this.firstChild.childNodes[i];
        this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
        this.thumbHolder._x = i*spacing;
        this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image",
0);
        this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
        this.thumbHolder.title = this.picHolder.attributes.title;
        this.thumbHolder.main = this.picHolder.attributes.main;
        this.thumbHolder.onRelease = function() {
            loader.loadMovie(this.main);
            title_txt.text = this.title;
        };
    }
};
BrnstormWilly - 12 Aug 2008 16:45 GMT
You need to switch from using loadMovie to using the MovieClipLoader object.
This object has a listener called "onLoadInit" that allows you to get the size
of your photo when it comes in, but before it appears on stage, so that you can
adjust its placement. Check out the help docs for info on usage.

WL
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.