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
 
Thanks, one more question, the data are not been embeded in the dataGrid in your sample, is it normal ?
 
Yes sorry I probably should have removed that to avoid confusion.

I usually place a datagrid on the stage to make sure that all of the connections are working correctly. At that point I usually remove the grid unless it is part of the interface. In this case you will see on frame one I set the DG's visibility to false. If you need help implementing a datagrid let me know.

Hope it helps.



Wow JT that almost looked like you knew what you were doing!
 
I would appreciate you give me some help / tutorial how to implement the datagrid.

cheers
 
In frame 2 of layer 1 in the sample delete the data grid.

In frame 1 of layer 1 select the datagrid and Cut it from frame one. Create a new layer and paste the grid on the new layer. Then comment out the actionscript line that makes the grid invisible. (make sure that the gray background appears in frame 2)

It should then work for you. The items you need to look at are the datasource and the selected index under bindings in the Component Inspector. You will see that the datasource for the grid is the dataset component and the selectedindex is also bound to the dataset.

Let me know if you need more help.



Wow JT that almost looked like you knew what you were doing!
 
well very good all my data are displayed in the dataGrid.

Actually I did a mistake, what I would like to do is put all the targetClip in a scrollpan as it is basically in the newezra website.

cheers
 
I create an other layer drop the scrollpane into the layer, but I don't know what to put into the content path box in the settings in order to tell flash to put all the data from the xml file into the scrollpane.

I don't think it's possible to do binding with this component.

I am a little bit lost :)
 
You can't use the scrollpane like that. Scrollpanes can load SWF's, JPG's, and MC's that are set to export for actionscript.

What you can do is place the information and logic to pull from the XML in a seperate flash movie and load that movie into the scroll pane.

If you are just trying to scroll through all the data the datagrid will do that automatically.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
the only problem is when your loading your xml data stuff from a separate swf containing the scrollpane, all dynamic field (ie xml stuff) doesn't appear at all.

The swf is loading because I can see an object i put but there's no xml at all.

Any idea ?
 
It's not possible to change the code of frame two like follow (where myPane is the instance name of the scrollpane):


function addMovieClips(i) {
//loop through data and create a new instance of the targetClip for each record.
while (_root.data_ds.hasNext()) {
//trace("called else");
myPane.attachMovie("targetClip", "site"+i, getNextHighestDepth(), _root.data_ds.currentItem);
_root["site"+i]._y = _root["site"+i]._y+(i*100);
i++;
_root.data_ds.next();//this is important don't leave it out or the script will bomb.
myPane.vScrollPolicy = "on"
myPane.refreshPane();
}
}

not working anyway...
 
Will have to look into this. It looks like a timing issue because part of the datagrid is rendered correctly.

 
This thread has helped me immensely in loading external images into a flash mx 2004 data grid. I have a question that hopefully someone can help me with... I want to load the images into multiple columns...not just one long column. Something like:

1 4 7
2 5 8
3 6 9

Can anyone assist with the modifications to the flash script:

//goto first data set record
_root.data_ds.first();

addMovieClips(0);

function addMovieClips(i) {
while (_root.data_ds.hasNext()) {
//trace("called else");
attachMovie("targetClip", "site"+i, getNextHighestDepth(), _root.data_ds.currentItem);
_root["site"+i]._y = 5+ _root["site"+i]._y+(i*125);
_root["site"+i]._x = 5;
i++;
_root.data_ds.next();
}
}
stop();


Thanks
 
I've been trying to make sense of how to scroll this portfolio.
However I've been running into brick walls with it. Everything else
works great. Could someone post a link to a .fla of this that scrolls
or some AS. I would really appreciate if some help on this.

_mag
 
Hi all, hey Pixal8r are you still viewing this thread, if you are I am wondering if you would know how the hell I can do this I want to place all the xml data that is loaded with the xml connector into a scrollpane and I cant, I thought I had it done but my previouse solution isnt so great it doesnt bring up the scrollbars all the time, I need something more solid :( please someone help me this thing is due very soon I am ripping out my hair.

Thanx again guys

W i K
 
hey GUYS I FINALLY DID IT!!! this is how you get the xml data to be scrollable in your scrollpane. You gotta put your xml connector and all other objects and frames that go with it into an MC(movieclip symbol)and give it a linkage name than on your main timeline put a scrollpane and tell it to load the mc with the xmlconnector. now from the mc that you load the xml data with on you second frame you should have an actions layer with a function and a while loop in the function now after the while loop but before the function closes you have to tell the scrollpane to set its vscrollpolicy to on, like this:
Code:
_parent._parent.MyScrollPane.vScrollPolicy = "on"
I hope this helps alot of people as it sure helped me but I wouldnt have gotten this far without the help of pixel8r helping me with the first and largest step.

if anyone needs anyhelp with this let me know :)

Thanks all

W i K
 
wilkfx could you explain this again and maybe post the code for the function
i 've been struggling to get this to work. It would be very helpful at this point
 
hey here is what the code in the second frame should look like with the SCROLLBAR activated!!
Code:
//goto first data set record
_root.data_ds.first();

addMovieClips(0);

function addMovieClips(i) {
        //loop through data and create a new instance of the targetClip for each record.
    while (_root.data_ds.hasNext()) {
        //trace("called else");
        attachMovie("targetClip", "site"+i, getNextHighestDepth(), _root.data_ds.currentItem);
        _root["site"+i]._y = _root["site"+i]._y+(i*100);
        i++;
        _root.data_ds.next();//this is important don't leave it out or the script will bomb.
    }
   //this is the part where you set the scrollbar to ON so
   //that it sets itself after the data is loaded, also
   //check your targeting as mine was _parent._parent your
   //might be different. 
   _parent._parent.MyScrollPane.vScrollPolicy = "on"
}
stop();

hope this helps :)

W i K
 
wikfx, thanks for posting that code it's greatly appreciated.
unfortunately coming from a mostly design background I am
new to programming and i'm still having some issues here.
maybe if its not too much trouble you could post
a functioning example I could play with. Because
it looks like i'm a little in over my head on this one.
One thing thats happening is I'm getting an output of

**Error** Scene=Scene 1, layer=Actions, frame=2:Line 7: Syntax error.
        //loop through data and create a new instance of the targetClip for each record.

**Error** Scene=Scene 1, layer=Actions, frame=2:Line 8: Syntax error.
    while (_root.data_ds.hasNext()) {

Total ActionScript Errors: 2 Reported Errors: 2

so the first one i fixed by just removing moving that comment.
The while loop i don't know what to do here.
I put everything in an MC and created a linkage id of myXml.
then i put a scrollpane on the main timeline and gave that an instance name of MyScrollPane. That displayed an empty scrollpane.

Thanks in advance for any help on this.

 
If you can post your .fla Mag we'll help you get it working. That is easier than trying to help you figure out your problem blind. :)
 
Been trying to follow your tute for a couple of days now, but have managed to tie myself in knots!
Done the 1st part o.k.
But can you tell me exactly what (and how) to place the components inside the MC.
If I create an MC and paste the XML connector & Data set inside the bindings gets broke and it all goes pear shaped.
Pointless trying to post anything as I've changed everything a 100 times.
If maybe someone else could post a working example that would be fantastic, else a complete breakdown of steps following on from the pixl8r dynamicportfolio.

Peace
 
You can't copy and paste the dataset and the XMLConnector. Unfortunately it breaks the bindings (which you have discovered). Rather than copying and pasting into your MC, simply pull new components (connector and dataset) into the MC and follow the steps waaaay at the top of this thread for setting it up.

Just post again if you still need help.

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