PDA

View Full Version : List with vBox'es scrolling problem


Kencabaldux
08-26-2009, 07:22 PM
Hello,

Here's a project, I'm working on for two days now, it's a simple guestbook:

http://loadinhq.lt/shoutbox_cms/temp/LoadinHQShoutbox.html

It has a simple HTTPService that populates the ListBox with VBox'es, containing two text fields: one for username, and one for entry (shout).

The problem is, that, when you scroll it all the way down, and then, all the way up... The top entries get crampled. I don't want that, how can I solve this bug?..

Here's my source code:

Main App:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="refreshComments(event)">

<mx:Script>
<![CDATA[

import com.danzen.utilities.*;
import mx.controls.Alert;

private function usernameNotValid():Boolean
{
CONTENT REMOVED FOR SECURITY
}

private function checkComment():void
{
if ((username.text == "") || (entry.text == "") || (usernameNotValid()))
{
Alert.show("Neteisingai įvestas, arba neįvestas vartotojo vardas ir / arba tekstas",
"KLAIDA!");
} else {
var event:Event = new Event("BELEKAS");
postComments(event);
}
}

private function postComments(e:Event):void
{
var request:URLRequest = new URLRequest(CONTENT REMOVED FOR SECURITY);
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;

var variables:URLVariables = new URLVariables();

CONTENT REMOVED FOR SECURITY
request.data = variables;
request.method = URLRequestMethod.POST;

loader.addEventListener(Event.COMPLETE, commentSent);

loader.load(request);
}

private function commentSent(e:Event):void
{
var event:Event = new Event("NOTHING");
refreshComments(event);
}

private function refreshComments(e:Event):void
{
commentService.url = CONTENT REMOVED FOR SECURITY
commentService.send();
}

]]>
</mx:Script>

<mx:HTTPService id="commentService" />
<mx:List id="commentList" dataProvider="{commentService.lastResult.winners.psl}" height="100%" width="100%" wordWrap="true" variableRowHeight="true"
itemRenderer="commentEntry" top="10" left="10" right="216" bottom="10"></mx:List>
<mx:TextInput width="198" right="10" top="55" id="username" />
<mx:Label text="Palik savo komentarą!" fontSize="12" fontWeight="bold" fontStyle="normal" textDecoration="normal" right="55" top="11"/>
<mx:Label text="Vardas:" right="160" top="39"/>
<mx:TextInput textAlign="left" width="198" right="10" top="105" bottom="61" id="entry"/>
<mx:Label text="Pranešimas:" right="133" top="89"/>
<mx:Button click="checkComment()" label="Siųsti!" width="198" height="43" fontStyle="normal" bottom="10" right="10"/>

</mx:Application>

commentEntry.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" autoLayout="true" verticalScrollPolicy="off">

<mx:Text text="{data.pav}:" width="100%" fontWeight="bold" fontStyle="italic" />
<mx:Text width="100%" paddingTop="-10" text="{data.apie}" />

</mx:VBox>

amarghosh
08-29-2009, 07:25 AM
the link shows a blank flex swf and nothing else...