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 SkipVought 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
0
0
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
 
Cheers for replying.

What I have trid to do is this:

<PARAM NAME="flashvars" VALUE="xmlurl=lecturas4611.xml">
plus flashvars="xmlurl=lecturas4611.xml" in the embed tag of my asp page.

in flash:

var xc_url:String
xc_url = _root.xmlurl
this.xc_xml.URL = xc_url
this.xc_xml.trigger();

if I type the variable name in by hand my flash movie works
eg: xc_url = "lecturas4611.xml"

What am I doing wrong?

 
Try it this way:

Code:
//example
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"[/URL]
 WIDTH="550" HEIGHT="400" id="movie" ALIGN="">
 <PARAM NAME=movie VALUE="movie.swf[highlight]?xmlurl=lecturas4611.xml[/highlight]">
 <PARAM NAME=quality VALUE=high>
 <PARAM NAME=bgcolor VALUE=#FFFFFF>
 <EMBED src="movie.swf[highlight]?xmlurl=lecturas4611.xml[/highlight]" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="movie" ALIGN=""
 TYPE="application/x-shockwave-flash" PLUGINSPAGE="[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer"></EMBED>[/URL]
</OBJECT>

Leave your other script as is.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Thanks for that. But my flash movie still does not show the values from the XML file. The source code for the page shows that the HTML is correct.

Is there any thing that I have to do in more in the flash movie? If it works by manually typing in the variable to the actionscript why is it not picking it up now?

Is there anything I can do in the flash movie to show what variable is being passed if any?

I am lost.

 
Add a trace statement on the first frame (actions layer) of the movie.

Code:
trace("The variable is " + _root.xmlurl);

You should get "The variable is lecturas4611.xml".

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Hey Pixl8r

any news on that xml weather thing? after some research I found something called xpath but I am still in the same problem, xpath is sopposed to work for matching the attributes but I cannot seem to get it to work :( anyway let me know if you figured anything out

Thanks

W i K
 
Hi! I've been using this xml based stuff for a while, and it's great, but i'm stucked with a problem. I'd like to put an html link in the "summary" text, but once i inserted a <href> it doesn't show any of the text on that node. Is there any solution, to include html links? Thanks a lot!
 
hey stalker in the xml you cannot use the < or > symbols, instead you have to use &lt: and &gt; so your <href> tag will look like : &lt;href&gt; I had the same problem and this is how I worked it out

Hope this helps

W i K
 
Hi Pixl8r, W I K, or anyone who can help! :)

Here is my big fat problem:
If you dl. it you can see that the duplicated movieclip "targetClip" reads the html formated text just fine, but when the content is passed to the detailMc, it just does not work and i could not figure out where is the problem.
I've got to get this stuff working very soon. Please help me out!
 
Very easy fix. In detailMC:

Code:
function setOptions(title,summary,theURL,previewURL){
	detail_title.text = title;
	[highlight]detail_txt.html = true;[/highlight]
	[highlight]detail_txt.htmlText = summary;[/highlight]
	//detail_txt.text = summary;
	portfolio_btn.onRelease=function(){
		loadMovie(theURL,_parent.popup);
	}
	loadMovie(previewURL,"detailImage");
}

That should take care of it.

Wik: Sorry buddy haven't come up with anything yet, but I'll let you know if I have an epiphany!

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Hmmm...I cant't try it right now, only later, but if it helps, you saved me from some trouble! :) Thanks a lot.
Ill get back to let you know if it works. bye
 
Hi! Ive got a brand nu question, still about this dynamicPortfolio stuff. Now, ive got to make it scrollable,
which i already did for a few times, with the scrollpane component, describet earlier. But now i need to use a "homemade scroller". Could you help me out, i'm stucked, and can not figure out where the problem is. Here is what i'm working on - Thanks again!
 
hi Pix

I came up with yet another problem I am trying to do a sort on my xml because I want my last xml rcord to show first, do you have any ideas to what I can do????


Thanks

W i K
 
Hi Wik,

Just add a sort to the dataset and do a find on it. Here's an example of one that I am using. I hope it makes sense.

Code:
_global.getSelectedModel = function(id:Number) {
	dataAccess = _level0.application.dataAccess;
	if (dataAccess.prodDetails_ds.hasSort("id")) {
		dataAccess.prodDetails_ds.useSort("id");
	} else {
		dataAccess.prodDetails_ds.addSort("id", ["productID"], DataSetIterator.Ascending);
	}
	if (dataAccess.prodDetails_ds.find([id])) {
		theID = dataAccess.prodDetails_ds.getItemId();
	}
	if (theID != null) {
		dataAccess.prodDetails_ds.locateById(theID);
	} else {
		trace("no Result");
	}
};

This function is called when a user clicks on a button to retrieve details from the dataset for that specific item id.

Hope it helps. Did you find a solution for you other problem?

Wow JT that almost looked like you knew what you were doing!
 
First post for me - this thread has give me very much info but I'm missing a crucial element or two.

Like others here, I'm building a flash element that will show product details but they are organized in 9 clusters. So what I need to do is allow a visitor to click on a cluster that then takes them to another frame with a list component and various text fields. When you select the product from the list, detail is populated in the other fields.

I am comfortable with everything from the list component on but I cannot figure out how to associate a node within my xml file with a button on frame 1... Each of the 9 buttons should result in the next frame showing a different list of products. At the moment the website has 9 different swf's and 9 different xml files so that I get around this.

Now the client wants to update and I'm in a mess ;)

help?

Thanks all!
 
ferdig, I don't know if this will help or not, but I figured it's worth a shot. I ran into a similar problem once & someone put together these objects (AS 1.0) so I could pull data by node name instead of through the parent/child relationship:

Code:
	// prototypes to separate out number of different kinds of nodes

	Object.prototype.childrenOfType = function(s,a) {
		if (a == undefined) {
			a = new Array();
		}
		var n = this.firstChild;
		while (n) {
			if (n.nodeName==s) {
				a.push(n);
			}
			n = n.nextSibling;
		}
		return a;
	}

	Object.prototype.firstChildOfType = function(s) {
		var n = this.firstChild;
		while (n) {
			if (n.nodeName==s) {
				return n;
			}
			n = n.nextSibling;
		}
		return null;
	}

	ASSetPropFlags(Object.prototype,null,7);

This allowed me to pull the node information into arrays, which made the population stuff a whole lot easier.

On re-re-re-reading your post :) would it help/have you tried reorganizing the XML file so that you have 'master' nodes that hold all info, including product lists, within them?

Good luck!

tigerjade

"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
The script I posted above for Wik does what you need. It pulls a record from the dataset based on the id provided to the function. You set the id when you render the buttons.

I use the function above to select a specific product from the dataset based on a button click.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Thank you both for your replys - its starting to make sense..

I think pixl8r's looks a bit simpler but still contains some things that are not needed for my application - such as sorting?

I need to fool with it a bit - a follow on question to this is once it knows which product cluster to pull, how do I tell it to display the first product in the cluster rather than showing "undefined"?

This may be where tigerjades script comes in?
 
You have to sort the recordset before you can "Find". Just the way it's set up. So if you want to dynamicly access a record you have to first sort the dataset.

Otherwise it's datasetname.currentItem for all of the values in the current record or datasetname.currentItem.fieldname for a specific record.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Hi PIX once again I am stuck, I am building an xml photo gallery ad I am using the loader componant for my images to load into. now, I have 2 problems, the loader componant is sopposed to resize my pics but it doesnt alway resize them, that one and the other is sometimes some of the pics load but they dont show??? do you have any ideas? should I be using something like onloadcomplete so that it waits for the xmldata to be fully loaded????

Thanks

W i K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top