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
 
Did you make that the last thing before the dataset.next() statement?
 
yea I put it before the dataset.next() and it returns undefined than I put it before the i++; and it returns the static size without text in it

WiK

W i K
 
It's got to be a timing thing. Did you try placing it on the first frame of the dynamic MC? Set a _root variable that can be checked by the loop.

It's going to be tricky on the timing either way.
 
Hey I figured it out I dont have to measure the height of the text box but of the whole clip like this
Code:
trace("DDDDDD>> this is the dynamic height" + this["site"+i]._height)

and is has to be done right before the

i++;
dataset.next()

now I just gotta figure out a way to implement it into the rest of my code

:)
Thanks again oh great pixl8r

W i K
 
Hey pixl8r sorry to bug you again but that code for height test didnt work either because I still had something calling the currentItem.length so the height thing was working with that, :( I still cant get my clip height :( :(

do you have any other ideas?

W i K
 
Hey pixl8r,

I am in the process of making a website which i need a gallery to work almost exactly as the original question on this page, and this turtorial has been awesome! On my gallery though i have the list on the left as per the first sample file, but also need to mix in some of the file you posted on th 24th jan.
I need to have the list on the left with the image, title and part of the description, but when you select one of the items in the list i need the title, full description and a larger image to appear in the right (main) section of the page.
As the list on the left is not a data grid how do i get it to trigger the data to be returned to the main section. Also how would i get the data to run into dynamic text fields and load the larger main image?

Thanks for your help!
 
Hey Wik... sorry I haven't thought of anything yet, but I'm still stewing on it. :)

Blaa... What is the list on the left? ListBox? Something else?
 
OK that's easy enough. What does your data look like? The XML source?
 
<portfolio>
<item id="1" title="client1" logoURL="images/logo1.jpg" previewURL="images/preview1.jpg" summary="nsdfjkghkljsahdfg lkasgkdfgjha slkj gbkjasg jaskjg kajs gkjabsdkjfg a;ksj gk;jas gkjhas ; gk.ajsddfg kjasdfjkg as dgj ks" portfolio="client1.swf" />
<item id="2" title="client2" logoURL="images/logo2.jpg" previewURL="images/preview2.jpg" summary="nsdfjkghkljsahdfg lkasgkdfgjha slkj gbkjasg jaskjg kajs gkjabsdkjfg a;ksj gk;jas gkjhas ; gk.ajsddfg kjasdfjkg as dgj ks" portfolio="client2.swf" />
<item id="3" title="client3" logoURL="images/logo3.jpg" previewURL="images/preview3.jpg" summary="nsdfjkghkljsahdfg lkasgkdfgjha slkj gbkjasg jaskjg kajs gkjabsdkjfg a;ksj gk;jas gkjhas ; gk.ajsddfg kjasdfjkg as dgj ks" portfolio="client3.swf" />
</portfolio>
 
thats the data i basically need. I just modified the file from your original project. the portfolio="file.swf" bit is for the "view portfolio" link on the diagram. I was hoping i could pass the variable to the button so when clicked it loads the right swf!

Thanks very much for your help :)
 
OK create an invisible button in the library (a button instance that only has a "hit" keyframe). Open the targetClip movieclip and add the invisible button you just added to the library to the MC. For starters place it over the thumbnail image. Resize the button to taste.

In the library create another new MC (let's call it detailMC in the library). This is for your larger image and details. In this clip place a dynamic text box with the instance name "detail_txt". Add your "View Portfolio" button (instance name "portfolio_btn" for example) and add a blank movieClip (instance name "detailImage"). Then right click the detailMC clip in the library and select "Linkage...", the select Export for Actionscript and except the defaults.

Now back to the targetClip. On the invisible button add the following:

Code:
on(release){
	//All of the variables are available in this clip by their XML names.
    _level0.attachMovie("detailMC","itemDetails",_level0.getNextHighestDepth(),{imageURL:previewURL,prevSummary:summary,porfolioURL:portFolio,_x:200,_y:200});
}

Then in your detailMC add an actionscript layer and add the following.

Code:
summary_txt.text = prevSummary;
function portfolioClick(theURL){
	loadMovieNum(theURL,1);
}
portfolio_btn.onRelease = portfolioClick(portfolioURL);
loadMovie(previewURL,"detailImage");

Test the movie. I haven't tested it so let me know if it isn't working right or if you need any additional help.

Wow JT that almost looked like you knew what you were doing!
 
What were the errors? I can't test it without all of the files (XML and images too :))
 
Ok you had a couple of problems. First and biggest is that your XML and Dataset schemas were the sample schemas, and not set for your particular datasource. So you were only getting some of the fields in your XML data. I fixed that. (just review the section on setting up the schemas waaaaay at the top of this thread).

The code errors were very bizzarre, I just retyped exactly the same code again and it works just fine. That revealed that there is a problem using the attachMovie command within the scrollpane... it just doesn't work.

So I removed the linkage from the detailMC and gave it the instance name detailMC instead. I added a function to it to populate the fields (inside detailMC). Then I call that function from the invisible button (in the targetClip) feeding it the values particular to that item (and elminate the attachMovie action).

Here is your file

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Iv'e been following this thread closely and wanted to see how the end result turned out. I downloaded the file above and it refuses to open - possibly it needs to be "zipped" first - maybe it got corrupted during the upload/download..?

Could you post a zipped copy?
 
Just to be sure are you using Flash MX 2004 Professional?
 
hey pixl8r I figured it out I am using the ._height to figure out the height of the clip and setting it from there it finally WORKED!!!
thanks

W i K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top