Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-30-2008, 09:04 PM   #1
pcinfoman
Registered User
 
Join Date: Dec 2008
Posts: 8
Default Mixing HTML and Actionscript in Flex 3

I am using Flex Builder 3 and all this is extremely new to me.

I have it reaching out to my mySQL database and displaying 4 of the columns in it (which is what I asked it to do). However, I want to have the results of the "prod_title" column display as a link to the product page. The url to that page is held in the "prod_url" column. My current Flex code looks like this.

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	initialize="doSend()" 
	layout="absolute" 
	backgroundColor="#FFFFFF" 
	maxWidth="710" 
	maxHeight="710" 
	width="710" 
	height="710" 
	borderThickness="1">
	<mx:TitleWindow 
		height="60" 
		layout="absolute" 
		title="Complete Animal Index" 
		fontSize="36" 
		color="#000000" 
		horizontalAlign="center" 
		id="title" 
		verticalAlign="top" 
		showCloseButton="false" 
		themeColor="#FFFFFF" 
		width="500" 
		horizontalCenter="12" 
		top="2" 
		fontFamily="Verdana" 
		textDecoration="normal" 
		fontWeight="bold" 
		backgroundColor="#FFA800">
	</mx:TitleWindow>

<mx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        import mx.rpc.events.ResultEvent;
       
        [Bindable]
        private var datalist:ArrayCollection;
       
        private function resultHandler(event:ResultEvent):void{               
                datalist = event.result.data.row;
        }
        public function doSend():void {
            xmlFromDatabase.url = "http://www.animalmakers.com/Testing/dbConnect.php";
            xmlFromDatabase.send();
        }
    ]]>
</mx:Script>
<mx:HTTPService url="http://www.animalmakers.com/Testing/dbConnect.php"
    id="xmlFromDatabase"
    showBusyCursor="true"
    result="resultHandler(event)"
    method="GET" />
    <mx:DataGrid x="1" y="72" dataProvider="{datalist}" id="dg" width="700" height="618">
        <mx:columns>
            <mx:DataGridColumn headerText="Stock No" width="65" dataField="stock_no"/>
            <mx:DataGridColumn headerText="Product" width="335" dataField="prod_title"/> // I WANT TO ADD THE LINK HERE
            <mx:DataGridColumn headerText="Category" width="150" dataField="category_1"/>
            <mx:DataGridColumn headerText="Sub-Category" width="150" dataField="sub_cat"/>
        </mx:columns>
    </mx:DataGrid>


</mx:Application>
Ideas?
pcinfoman 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
Actionscript project html settings in Flex 3 darth Flex 2, 3 & 4 1 11-12-2008 09:28 AM
Converting Javascript formatting to Actionscript in Flex Mutley Flex 2, 3 & 4 0 08-14-2008 11:03 AM
help converting this html AHREF command into actionscript -Havoc- Flash 8 General Questions 0 04-25-2007 06:45 PM
Passing actionscript to flash from html? alsvik HTML and JavaScript 2 04-05-2005 03:25 PM
Actionscript into HTML quote translator z3n ActionScript 1.0 (and below) 3 10-24-2003 05:05 PM


All times are GMT. The time now is 01:43 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.