Adobe Dreamweaver Forums



Last 10 THreads :         CS4 No Quiz Templates (Last Post : jessediaz - Replies : 4 - Views : 5 )           »          Director Stage when Publishing (Last Post : openspark - Replies : 1 - Views : 2 )           »          Compatible issue with ie6 (Last Post : JoeyD1978 - Replies : 1 - Views : 2 )           »          captions for photos (Last Post : Walt F. Schaefer - Replies : 1 - Views : 2 )           »          Uncatchable Error 2101 (Last Post : M4G1C14N - Replies : 1 - Views : 2 )           »          File Transfer (Last Post : aruvasavi - Replies : 2 - Views : 3 )           »          Objects "Framed" when moving layer (Last Post : VegasMirage@adobeforums.com - Replies : 2 - Views : 3 )           »          Creating images to look like original oil paintings? (Last Post : Ian_Courtney@adobeforums.com - Replies : 0 - Views : 1 )           »          Opening a file in navpane from toolbar (Last Post : ChrisRousset - Replies : 0 - Views : 1 )           »          Help importing PNG sequence (Last Post : []MULISH - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:37 AM
light_ray
 
Posts: n/a
Diggs:
Default Help with dynamic button click inside titleWindow

Hi Everyone, Your Help is much appreciated

I am building a flex application and I want the user to click on a button and
send them to another website. Basically I am creating a tileList that holds
thumbnails (created using item renederer) and on click a popup with the same
image and button will be created. I get errors when I click the link button.
This is what I have so far:
// This is my custom item renderer

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center"
verticalAlign="middle">
<mx:Image source="{data.@thumbnailImage}" />
<mx:Label text="{data.@title}" />
</mx:VBox>

// My TileList
<mx:TileList id="tileList"
dataProvider="{xmlListCollection}"
itemRenderer="CustomItemRenderer"
maxColumns="4"
columnWidth="140"
rowCount="2"
rowHeight="140"
verticalScrollPolicy="off"
horizontalScrollPolicy="off"
itemClick="tileList_itemClick(event);" />

// This is my code
private function tileList_itemClick(evt:ListEvent):void {
// Set the TitleWindow
myTitleWindow = new TitleWindow();
myTitleWindow.title = evt.itemRenderer.data.@title;
myTitleWindow.width = 350;
myTitleWindow.height = 600;
myTitleWindow.showCloseButton = true;

// Set the Image
img = new Image();
img.maintainAspectRatio = true;
img.buttonMode = true;
img.useHandCursor = true;
img.source = evt.itemRenderer.data.@fullImage;
img.addEventListener(MouseEvent.CLICK , image_click);


//Set the Label
myLabel = new Label();
myLabel.text = evt.itemRenderer.data.@title;
myLabel.setStyle("fontWeight","bold");

// Here I set the Button but its not functioning
var btn:Button = new Button();
btn.label = evt.itemRenderer.data.@link;
btn.buttonMode = true;
btn.addEventListener(MouseEvent.CLICK,clickHandler );


myTitleWindow.addChild(img);
myTitleWindow.addChild(myLabel);
myTitleWindow.addChild(btn);

PopUpManager.addPopUp(myTitleWindow, this, true);
PopUpManager.centerPopUp(myTitleWindow);
}
// This is the Part I can't get it to work
private function clickHandler(e:MouseEvent):void{

var url:String = "http://" + data.@link;
var myRequest:URLRequest = new URLRequest(url);
navigateToURL(myRequest,'_blank');

}

My xml looks like this
<gallery>
<image title="Image One"
thumbnailImage="assets/big.jpg"
fullImage="assets/small.jpg"
link="www.google.com"
description = "Search Google"/>
</gallery>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2008, 04:37 AM
ntsiii
 
Posts: n/a
Diggs:
Default Re: Help with dynamic button click inside titleWindow

What error?

Is your url being concatenated correctly? Trace it.

Tracy
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 04:49 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk