Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flash with XML database 8

Status
Not open for further replies.

wikfx

IS-IT--Management
Dec 16, 2001
196
MT
Hi I am trying to do a client list for someone and they want soething like this: you have to go to the portfolio section of that page to see it. anyway is that done with an xml backend? I am trying to do it with xml so that it would be very easy to update can anyone help?

WiKfx

W i K
 
Unforunately you can't load the XML until the frame calling the XMLConnector.trigger is loaded. If you followed my example there is already a listener in place for when the data is loaded. You could customize that a bit to show some kind of loading dialogue.

Wow JT that almost looked like you knew what you were doing!
 
Where is the listener?? not sure what ur talking about...how can i customize that? Sorry i'm a little confused. JP
 
First frame of the Actions layer in portfolio.fla. It should be commented. To customize change the afterloaded event.

That help?

Wow JT that almost looked like you knew what you were doing!
 
dataListener.afterLoaded = function(){
gotoAndPlay(2);
?? extend frames and get it to go to like frame 6...put a preloader in between that??? I would i customize that...i have no clue. JP
 
Hi pixl8r

Hi I am using this method to connect to an rss feed and everything looks fine when I run it on my pc but when I try to run it from online the feed doesnt come up?? any idea??? this would be a big help I have a star ready on my desk :) hahahaha anyway let me know if you have an idea


Thanks again






W i K
 
pixl8r I got it :), apparently in flash 7 you cannot load data from ifferent domains so you cannot load an rss feed from say yahoo or whatever unless the server hosting the rss has a crossomian.xml file in thier root. what this file does is that it is a policy file that flash looks for. now if you really want to read rss feeds from say yahoo after banging my head against my monitor so many times I finally foun this link:


Ironic how Macromedia makes the policy and also gives you instructions on how to override it strange but as long as it works and it does :) I hope this helps many people.

have a nice day

W i K
 
Well I guess the point is that the afterLoaded event fires when the XML load is complete. In the case of the example the listener prevents the movie from going to frame 2 until the XML load has completed (so that the movie has data for the other actions).

What is it that you are trying to do?

Thanks Colonel, glad it's helpful. :)

Wow JT that almost looked like you knew what you were doing!
 
I'm just basically trying to preload the xml after the scrollpane is loaded...the xml that's in the scrollpane. I wanna have something saying like xml loading and then it loads. I can't figure it out with the way i have it...ur example...??any ideas. You want me to post my .fla?? JP
 
Sure but be sure to include everything (XML, Images, etc...) Zip the whole thing up and post it all.
 
hi all.
hey pixl8r,
i have made an image gallery following your example waaay at the beginning of this thread. it works like it's supposed to, but now i would like to alter it a bit, and i'm having some trouble getting it to work the way that i want.

basically i want to do the same thing, but instead of placing the my whole list of loaded images on the stage or in a scroller with script, i would like to 5 images at a time, each into it's own movieClip 'holder'. then i could animate these 5 holder boxes to fade in over time or whatever. THEN i would like to have a "continue" button unload the current 5, and load in the next 5 from my XML list. similarly, a "back" button would unload the current and then load the previous 5.

i modified the XML to what i thought was a logical grouping, having 5 "url" child nodes in a "page" parent node. i hooked this all up in the components, but need some tips for the scripting on the 2nd frame of the main timeline.

if you have time, i put up 2 samples of what i'm trying to do here:

the first is your original script, just modified a bit for my purpose. it works!to a degree, but again, i don't know how i would load in 5 more pics at a time and i have no control over each loaded image.

the 2nd version (non-working) is set up with the new XML and 5 'holder' movie clips. (maybe i need to create 5 new movieclips - not just instances- and export each to actionscript?)

anyway, if you or anyone has some thoughts on this, anything at all would be great! thankx!!

-josh
 
hey again-
dunno if anyone is looking at this but if so, i 'think' i made some progress. the latest updates of my files are at the link above. btw, im using fmx2004pro.

i seem to have figured out how to load my images, with paths loaded from xml, into movie clips on the stage. i can populate all 5 'frames' by using loadMovie.and the appropriate Item from the dataset.

i believe my only problem now is getting the next set of 5 items from the dataset, and loading those images into the 5 frames. i added a 'next' button with this script on it:
Code:
on(click) {
  _root.XMLdataSet_ds.next();
}
i have a datagrid hooked up for testing and i see all the items in there AND when i click the 'next' button, the selection highlight in the Grid moves to the next line. i THOUGHT that would set the dataSet to the next group and then replace the image loaded with a new image - but no such luck.

perhaps i need to unload the loaded .jpg, then reload the same items, but now i'd be looking at 'line 2' of the dataset?? it looks like i got most of the data binding stuff working,i think i'm just missing something basic. any thoughts??

thanks!
 
hey! never mind! i figured this out. i basically just had to figure out the correct pathing, and then 'reload' the images from the current dataset item. if anyone wants this source code, lemme know. it's a nice little gallery...

i still get an error in the output window saying "Error opening URL "file:///D|/%5Fprojects/web/rp%5Fphoto/rpphoto%5Fweb/test2a/undefined""
this actually pops up 5 times - i assume it has something to do with my target movieClips but i can;t figure out what. this only apears when testing in flash - works great in a browser, so i guess i'll ignore it!

now i want to make each thumbnail open a pop-up window with a fullsize image in it. i found a custom component that may help me here. i guess i could also just call another variable from my XML with a link to the larger image. anyone have another (maybe better) idea?

anyway, if anyone would like to see the finished .fla lemme know.

thanks!
 
Adding an XML variable with the path to the larger file is the way to go (blaablaa69 above was doing something very similar).

Sorry I'm slow on this thread right now, been busier than all get out!

Wow JT that almost looked like you knew what you were doing!
 
Hey JP... I'm trying to look at it now but I think the file is corrupt. Every time I publish it crashes my Flash App. Might want to try posting it again.

Wow JT that almost looked like you knew what you were doing!
 
hey pixl8r
no priblem! we are all too busy i would guess ; )
anyway thanks for responding.

i'm taking your advice about pulling the path variable from XML. now i'm trying to use the PopUpManager class and a window component to open my larger images on top of my movie.

the flash doc is pretty good here - i can open a pop-up with a button click and i can have the window auto-size to fit the loaded jpg. BUT i can't get both of these things to happen at the same time! poo.

this loads an image into a Window component, auto resizes the window to the jpg, and lets me close the popup with thw windows close button. i just can't figure out how to trigger this with a button press insted of on frame.

Code:
var popUpWin = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, false, {closeButton:true, title:"cool popUp", contentPath: "image01.jpg"});

sizerPop = new Object();
sizerPop.handleEvent = function(evtObj){
	if(evtObj.type == "complete"){
    popUpWin.setSize(popUpWin.content._width, popUpWin.content._height + 25);
  }
}

close = new Object();
close.click = function(){
popUpWin.deletePopUp();
}

popUpWin.addEventListener("complete", sizerPop);
popUpWin.addEventListener("click", close);
button.addEventListener("click", sizerPop);

i thought that changing "sizerPop.handleEvent" to "click" would do it, but no good. i also tried putting this script on a button instead of a frame, but then nothing would work.

how bout yer thoughts on this one?
thanks for all the help!
 
Put it in a function and call the function with the onRelease event on the button.

Code:
function createPopUp(){
var popUpWin = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, false, {closeButton:true, title:"cool popUp", contentPath: "image01.jpg"});

sizerPop = new Object();
sizerPop.handleEvent = function(evtObj){
    if(evtObj.type == "complete"){
    popUpWin.setSize(popUpWin.content._width, popUpWin.content._height + 25);
  }
}

close = new Object();
close.click = function(){
popUpWin.deletePopUp();
}

popUpWin.addEventListener("complete", sizerPop);
popUpWin.addEventListener("click", close);
}
// add function to button
buttonName.onRelease = createPopUp();

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top