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
 
Right I'm new to this so I'll tell you the steps I take & you can tell me why I should stick to stacking shelves.
1. Make new movie clip named myClip, exported for Actionscript. Drag XML connector & DataSet component into it. Instance names: data_con & data_ds. Set data source to myData.xml
2. Grab schema for data_con. Add schema for Data_ds.
3. Bind data_ds to data_con using componenet inspector.

**QUESTION** Am I choosing the Data provider, XML Connector from myData and "item:Array"?

4. Copy targetClip into the library.
5. On main timeline drag scrollpane component on stage. Instance name: scroller. Point content path to myClip. Add second keyframe.
6. On new layer paste Actionscript for frames 1 & 2.

That's it.
When I export the movie just a sad, lonely scroller with no content.
When I check the variables using Debug can't find site1.

Any suggestions?
£6 an hour ain't no good to me
 
1. Make new movie clip named myClip, exported for Actionscript. Drag XML connector & DataSet component into it. Instance names: data_con & data_ds. Set data source to myData.xml

This is your problem. The XMLConnector and Dataset can't exist inside the MC that you have exported for Actionscript. They should exist in the timeline that is calling the attachMovie() action. Also I'm not quite sure what you mean about copying the targetClip to the library...

Wow JT that almost looked like you knew what you were doing!
 
Nope my feeble knowledge is simply not good enough.
My last attempt involved setting up an MC that included the XMLConnector & the DataSet & your Actionscript.
Then I went back to main timeline and dragged an instance of the scrollpane onstage & pointed it at the MC.
Same result. Boohoo.
Seriously, unless I find a tutorial for this I'm not sure I'm gonna crack it.
 
Need to see what you are trying to do. Can you post your file?

Wow JT that almost looked like you knew what you were doing!
 
I was dreading you'd ask me that as I don't know how.
Care to explain.
 
Place it on a web server somewhere and post the link to it here.

Wow JT that almost looked like you knew what you were doing!
 
Can you use .zip instead? Or simply post the .fla? I can't help you with the PHP anyway, my PHP dev server is not online right now.

Wow JT that almost looked like you knew what you were doing!
 
Is it really as easy as that?!
Anyway. Now that you can see my failed attempt. Is it possible to see if you can explain to me why I cannot get your original text and pictures movie to scroll like wikfx has managed. I don't know the degree of difficulty involved, but my knowledge of scripting is not basic, but it's not far above that.
Cheers anyway, pixl8r.
peace
 
OK your problem was really easy. The code to trigger the XMLConnector and iterate through the dataset has to be moved inside of the "myClip" MC. When using something like
Code:
_root.xmlCon.trigger()
the code expects the XMLConnector to be on the main timeline. In this case it was not on the main timeline.

You will see I changed the code slightly for the new paths. I also added the code to effect the scrollPolicy of the scrollpane as Wik provided.

Get it here

That should get you going on the right path.

Wow JT that almost looked like you knew what you were doing!
 
1.Thanx for the solution. I'm glad that I wasn't a million miles away, but I would NOT have finished it without your help.
2.Thanx for the patience displayed. It's a rare commodity (trust me I KNOW).
3.Hurry up and fix your local server I've got another movie in need of rescue.
4.On a serious tip. I hope you don't mind if I make one more post concerning this tute just to clarify all that I've learnt. Till the morrow.

Peace
 
Right JT, back again for the last time on this thread.
Once, again much thanx for the help on the tute.

Just to confirm then: I merely needed to tweak the code to point to where the components were located.

I now know tons more about my own ability to code than I did before (no shelf stacking for this dude!)
1. I can ask for help an not feel embarassed.
2. I can post a file (small to you but not to me).
3. I can experiment with both mine and others' work and ask for help if I get stuck.

I'm out
peace
 
That's the nuts and bolts of it. Best thing is keep plugging away... shelves are for pantries. :)
 
Pixl8r,

I've followed your tut and you've done an excellent job making me understand loading xml up to this point, but I have a few questions/problems:

I'm trying to create a small product database using xml and flash but am not sure how best to do it. What I'm trying to do is have a product list populated with xml that links to a single template swf/mc that then displays the selected products info and images.

So how do I pass the xml loading function between swf's/mc's/frames?

Sorry for the essay, hope you can help.

Thanks,
Phil
 
So you have a product list and you have imported it into Flash right? Now you want to click on a product in the list and get more details about that product? Am I understanding correctly?
 
Yep thats right, so I only have to create the one detailed page and it loads the corresponding data into it. But am not sure how to go about it.

Cheers,
 
Create an XML data source with all of the info in it. (connect as above) The difference is that you are going to create 2 different datasets. One let's say just the product name, and the other with all of the product information. (You probably only need 2 datasets if you are using a datagrid)

Then create an MC with a series of textArea's that are bound to the selectedIndex of the first dataset.

I have probably way oversimplified that... let me know if you still need help.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Thanks for the reply,

I kind of understand but am still not 100%, how do I make the first dataset load the MC that then loads the correct info?

Sorry for my lack of knowledge, I'm a designer trying to learn xml and advanced actionscipt. Do you know of any examples?

Thanks for your help.
 
You bind the selectedIndex of the second dataset to the selectedIndex of the first dataset.

So the loaded MC would not have any triggers in it at all... just textAreas that are bound to the fields of the second dataset. I will try to put together an example if I get a chance.

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