Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-26-2006, 09:07 PM   #1
stonyx
Registered User
 
stonyx's Avatar
 
Join Date: Jun 2006
Posts: 54
Default how to load the xml i want?

i am really new in flex and AS so any idea will help

this is my mxml
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*"
	creationComplete="srv.send()" viewSourceURL="srcview/index.html">
<mx:Style source="main.css"/>

	<mx:Script>
	
		<![CDATA[
import mx.styles.StyleManager;
        
			private function filterProduct(item:Object):Boolean
			{
				return item.name.match(new RegExp("^" + inputText.text, "i\*" + /abc|xyz/));
				//&& item.price >= priceSlider.values[0]
				//&& item.price <= priceSlider.values[1];
			}

		]]>
	</mx:Script>
	<mx:HTTPService id="srv" url="datos/datos2.xml"
		resultFormat="e4x" />
	<mx:XMLListCollection id="xlc"
		source="{srv.result.*}"
		filterFunction="filterProduct"/>
	<mx:Panel width="568" height="569" layout="absolute" backgroundColor="#800000">
		<mx:DataGrid dataProvider="{xlc}" height="485"
			editable="false" width="150" id="datagrid" scroll="true" change="xlc.refresh()">
			<mx:layoutConstraints>
				<mx:Anchor top="5" left="5"/>
			</mx:layoutConstraints>
			<mx:columns>
			<mx:Array>
			<mx:DataGridColumn columnName="name"/>
			</mx:Array>
			</mx:columns>
		</mx:DataGrid>
		
		<mx:TextArea width="353" height="291" textAlign="justify"  htmlText="{datagrid.selectedItem.desc}" 
			 wordWrap="true" styleName="main.css">
			<mx:layoutConstraints>
				<mx:Anchor right="25" top="5"/>
			</mx:layoutConstraints>
			</mx:TextArea>
		<mx:Image x="374" y="304" width="164" height="181"/>
		<mx:ControlBar>
			<mx:layoutConstraints>
				<mx:Anchor bottom="0"/>
			</mx:layoutConstraints>
			<mx:TextInput id="inputText" width="154"
				change="xlc.refresh()"  text="Buscar" backgroundColor="#f0eff1"/>
		</mx:ControlBar>
	</mx:Panel>
	
</mx:Application>
i need to ad 3 buttons to this file and each button will load a different xml depending on what i want to search on

any idea?
stonyx is offline   Reply With Quote
Old 06-29-2006, 05:17 AM   #2
firdosh
Registered User
 
Join Date: Dec 2004
Posts: 146
Default

are these files going to be local or loaded from a remote server ,cause if they are local you can just embed them using the Embed tag
[Embed source="my.xml" ]
private var myXML:Class

cheers
firdosh
firdosh is offline   Reply With Quote
Old 06-29-2006, 10:19 PM   #3
stonyx
Registered User
 
stonyx's Avatar
 
Join Date: Jun 2006
Posts: 54
Default

this project is for a distribution cd
like i said i'm really new with Action Script
do you have any example or something?
stonyx is offline   Reply With Quote
Old 06-30-2006, 06:14 PM   #4
stonyx
Registered User
 
stonyx's Avatar
 
Join Date: Jun 2006
Posts: 54
Default

Quote:
Originally Posted by stonyx
this project is for a distribution cd
like i said i'm really new with Action Script
do you have any example or something?

now i know how, it was something so easy
stonyx is offline   Reply With Quote
Old 07-13-2006, 10:05 AM   #5
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

Quote:
Originally Posted by firdosh
are these files going to be local or loaded from a remote server ,cause if they are local you can just embed them using the Embed tag
[Embed source="my.xml" ]
private var myXML:Class

cheers
firdosh
that is compile time embedding, keep this in mind/
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
External SWF won't load an External SWF Help please Arekaine ActionScript 1.0 (and below) 2 09-24-2004 11:30 AM
URGENT!!! More SWF load into a container movieclip kaol ActionScript 1.0 (and below) 3 09-22-2004 09:22 AM
load mp3 dynamically Navarone ActionScript 1.0 (and below) 1 08-01-2003 12:15 AM
Visible movie when load jundat ActionScript 1.0 (and below) 2 06-29-2003 11:37 AM
Load Order and FONT MADNESS Ashley Other Flash General Questions 7 04-18-2003 04:01 PM


All times are GMT. The time now is 04:29 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.