Flex :: Setting VerticalScrollPosition Not Working

Jan 7, 2010

I have a VBox that I am populating programatically, After a particular event (dragDrop) I do some calculations, reorder some variables, then re-build the VBox. This all works great, but I want the VBox to scroll back to the correct verticalScrollPosition. I tried even the simplest thing: myVBox.verticalScrollPosition = 200But I just can't get it to set the scroll position after it's rebuilt.

Edit: per Franky's response I realized that my dragDrop function was calling the rebuilder function then the position setter function back to back, which means it wasn't done being built when it was trying to set. Now I'm passing the position I want the box set to to the rebuilder function which sets the scroll position at the end of building the VBox and everything works out great.

View 1 Replies


Similar Posts:


Actionscript 3 :: Canvas' VerticalScrollPosition Cannot Be Changed In Flex

Mar 17, 2011

I have a weird problem with verticalScrollPosition in Flex.I have a content Canvas and a wrapper Canvas. The content is large (5000px X 5000px), the wrapper is 800px X 800px.

public var wrapper:Canvas = new Canvas();
public var content:Canvas = new Canvas();
wrapper.addChild(content);
application.addChild(wrapper);

I would like to set the wrapper's scrollbar position dynamically anytime. I can do it by calling its properties:

wrapper.verticalScrollPosition = A;
wrapper.horizontalScrollPosition = B;

This is working fine. But! If I set a default scrollbar position when the Canvas is complete:

wrapper.addEventListener(FlexEvent.CREATION_COMPLETE, function(e:FlexEvent):void{
wrapper.verticalScrollPosition = DEFAULT_A;
wrapper.horizontalScrollPosition = DEFAULT_B;
});

I can't set the verticalScrollPosition anymore:

wrapper.verticalScrollPosition = C;
trace(wrapper.verticalScrollPosition); // Outputs: DEFAULT_A

So the problem only exist if I set a default position using 'FlexEvent.CREATION_COMPLETE'.

View 2 Replies

ActionScript 3.0 :: Reset UIScrollBar Using VerticalScrollPosition?

Sep 15, 2009

I have a website with a dynamic text box on the stage. The three nav buttons each load in a .TXT file to the text box on mouse click. I am using the UIScrollBar component for scrolling the text that is dynamically loaded.

My problem is, when I scroll down in the text box, then click one of the nav buttons, the scroll bar doesn't reset to the top when the new text loads. I've done some research and it seems like I need to reset the verticalScrollPosition property to zero, but I can't figure out how to implement this. Flash states that it is an undefined property when I've put this line of code in to my script: myScrollBar.verticalScrollPosition = 0; I've also tried this, with no apparent effect: event.target.verticalScrollPosition = 0;

View 1 Replies

ActionScript 2.0 :: Setting Interval, Not Working Externally?

Feb 16, 2005

my code looks like this:

Code:
function playit(){
_root.gotoAndPlay(4);

[code]......

View 3 Replies

ActionScript 2.0 :: Setting OnSetFocus Text Not Working?

Jul 29, 2006

I'm absolutely and completely dumbfounded by this problem...

Code:
target.txtField.onSetFocus = function() {
trace(inputText.getFieldText()); // custom function, outputs a string (ex. "name")
if (this.text == inputText.getFieldText()) {
this IF statement runs through fine
this.text = ""; // won't work, no matter if I set it to empy or anything...
}
}

I'm probably doing something very stupid here... but I can't figure out what. I've done my research, gone over examples online and in books, still not working. The text field goes blank, but I cannot type into it, and it loses focus (if I try using Selection.setFocus(this); it doesn't work).

View 2 Replies

ActionScript 2.0 :: Setting Interval, Not Working Externally

Feb 16, 2005

my code looks like this:

Code:
function playit(){
_root.gotoAndPlay(4);
}
setInterval(playit, 58900);

It works nice when i play the movie, but when i load it from my main movie it doesnt works (obvious, "_main" changes to be the movie that is loading). Now, i used "_parent" but it doesnt work, "this" neither; so, thats my problem, when i load the movie with this code inside, into another movie it won't work. =(

View 3 Replies

Actionscript 3 :: Setting Source Of An Image Component Not Working?

Dec 10, 2011

I'm pulling in a xml-file with just one result in it. One of the nodes is picture, which contains a link to a picture. This is the xml-file:

<artist>
<id>502</id>
<name>Bad Religion</name>

[Code]....

I've tested the url, and it's correct. This is how I try to bind the url to the image instance (artistPic), but it's not working. Displaying the artist name does work.

var artist:XMLList = new XMLList(event.result);
artistPic.source = artist.picture;
lblArtistName.text = artist.name;

View 1 Replies

ActionScript 3.0 :: Setting Width And Height Not Working But ScaleX And Y Are?

Sep 28, 2009

let me know what i am doing wrong here. this DOES NOT WORK.

ActionScript Code:
//add image
imageLoader = new Loader();

[code]......

View 2 Replies

ActionScript 2.0 :: Setting Up The Tiles On The Screen - AttachMovie Not Working

Jun 22, 2011

I'm trying to build a little tile editor for a game I'm about to make, but in setting up the tiles on the screen something goes wrong. Here's the code:

[Code]...

the trace just spits a whole bunch of 'undefined's at me. I double checked the variables once again just to be sure, and they're all right.

View 1 Replies

ActionScript 3.0 :: Allow Full Screen In Html Tab In Publish Setting But It Doesn't Working

Nov 9, 2009

i have an fscommand with ActionScript Code:

fscommand("fullscreen", "true");

and i have checked the flash - allow full screen in html tab in publish setting but it doesn't working

View 1 Replies

Flex :: Setting Compiler.theme Option For Halo/Flex 4 In FlashDevelop?

Jul 12, 2010

Here's what works with ant build.xml:

[Code]...

I tried the following values in Project > Properties > Compiler Options > Additional Compiler Options but none of them worked:

View 2 Replies

Flex :: Security - Setting Wsdl Service In Flex Project Crossdomain.xml?

Apr 7, 2011

How can i settings crossdomain.xml my flex project.* this is my crossdomain.xml.

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>

[code].....

I've tried lots of different methods but my project send error message "Security error accessing url Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL [URL]"

put the file in different places

C:wampwwwMYPROJECTin-debugcrossdomain.xml
(my swf url : http://localhost/bin-debug/test.html checked http://localhost/bin-debug/crossdomain.xml its ok)
C:wampwwwcrossdomain.xml

I added the load line of the project

protected function application1_initializeHandler(event:FlexEvent):void
{
Security.loadPolicyFile("http://localhost/MYPROJECT/bin-debug/crossdomain.xml");
}

if flex server type select none everythings ok. but server type select PHP need crossdomain.xml how can i fix.

View 1 Replies

Flex :: Itemrenderer - Referencing And Setting A Single Item Renderer Instance In A Flex Tree At Runtime?

Oct 17, 2010

Anyone know how to change a single instance of an item renderer for a Flex tree item at runtime? To reiterate, I'm not trying to change the entire tree's item renderer like this:tree.itemRenderer = new ClassFactory(ItemRenderer2);I'm trying to change the item renderer of a single tree item like this (the following code does not work):tree.selectedItem.itemRenderer = new ClassFactory(ItemRenderer2);To put it more simply, does anyone know how to reference an instance of an item renderer and set it to a new item renderer class? I've tried using the Tree's itemToItemRenderer() method with no success.

View 1 Replies

Flex :: Limit Pyamf Flex Sessions Or Setting A Timeout?

Feb 22, 2010

How do I limit my amf sessions to flex over pyamf?

I have set up a pyamf gateway to that serves value objects that originate from a django admin panel, through sqlalchemy to my authenticated flex client. It's working great, however there is a problem. My sessions are persisting and clogging up the server, so after about 20 or so AMF sessions are authenticated, it refuses any more until I restart the server.

View 1 Replies

Flex :: Setting Background-color For Flex Tree Component?

Oct 21, 2010

I have a Flex Tree component in my app. I set the icons for open and close.
BUT I can't find something about changing the default background-color from white to something different.

obviously there is no background-color setable in css...

View 1 Replies

Flex :: Setting Disabled Button Appearance In Flex?

Apr 11, 2011

I'm making a trivia in an Air application, a question, three buttons, after you choose one, the right button gets coloured green, the wrong ones get coloured red. I was trying to do this changing the styles, so I created a Button.Right and a Button.Wrong style, but I also need to disable the buttons so they don't get clicked more than once while I'm showing the correct answers.

So I'm having trouble making it so the buttons don't look greyish and with the alpha turned down when I set their enabled property to false. I'm trying to be as minimalistic as possible here, changing disabled-overlay-alpha or disabledOverlayAlpha in the css file doesn't seem to do the trick, neither does changing disabledBorderColor

View 3 Replies

Flex :: 9scalling Is Not Working At Runtime (although Working In Flash)?

Jul 10, 2010

I created a 9-scalled background in Flash CS5 which is working fine in Flash CS5.But when i imported it as embeded graphic in Flex, and change dimensions in runtime, 9-scalling doesnt work.Here is my code.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]....

View 1 Replies

Flex :: Setting Value In A Datagrid?

Oct 9, 2010

how to set value at a cell level in a data grid

I used the following

private function dataPanel(rowindex:Number, Var1:Number, Var1Name:String, Var2:Number, Var2Name:String, Var3:Number, Var3Name:String, Var4:Number, Var4Name:String): void {
trace("rowindex ", rowindex)

[Code]....

col1,col2, col3, col4 are id's for the 4 columns in data grid rowindex increments for value in each row...

it compiles and i get an error- it gets a strange error when i try to assign col1[].

View 2 Replies

Flex :: MinWidth Setting Ignored?

Jan 27, 2011

For example:

sampleComponent.explicitMinWidth = 500;
sampleComponent.explicitWidth = 10;

Sets the width of the sampleComponent to 10, even though I've set the minimum width to 500.The same thing seems to happen with width. In Adobe's documentation, it states that 'measuredMinWidth - Specifies the default minimum height and minimum width of the component, in pixels. Flex cannot set the size of a component smaller than its specified minimum size.I've tried setting the measuredMinWidth as well, same result.Eventually, I tried every combination of minimum width settings I could, but they were all ignored when I set the width (or explicit width).

sampleComponent.measuredMinWidth = 300;
sampleComponent.minWidth = 300;
sampleComponent.explicitMinWidth = 300;
sampleComponent.width = 10;

Additionally, what is the difference between width and explicitWidth, in every case I've tried, they have performed identically (couldn't find any help on this either)

View 1 Replies

Flex :: Setting Up Project With Coldfusion?

Aug 26, 2009

We recently built a new dev server for flex builder and installed coldfusion 8. We currently have everything working on our old server using coldfusion 7. We copied the services-config.xml and our project over to the new server. It compiled fine, I updated all references to the new server. When I try to run the flex application I receive the following error:

Warning: Failed to load policy file from http://localhost/crossdomain.xml
* Security Sandbox Violation *
Connection to http://localhost/flex2gateway/ halted - not permitted from file://ourServer/folder/ourProject/bin-debug/ourProject.swf

We created a valid crossdomain.xml file on the localhost (which I wouldnt think would be necessary since everything is on the same server)

View 1 Replies

Flex :: Setting The Dataprovider Of A Tree?

Sep 18, 2009

public function fileBrowse():void {
var success:Boolean = fileRef.browse();
}

[code].....

View 2 Replies

Flex :: Manually Setting Max And Min On A VerticalAxis?

Oct 6, 2009

I have a candlestick chart that is working great when the numbers being dealt with are large but when the numbers are small the vertical axis starts at the very top of my data and ends at the very bottom. For example if my max number in my XML is 12 and my min is 11 the charts top is 12 and the charts bottom is 11 with 11.2, 11.4, 11.6, 11.8 in between. How can I force the chart to do 22 to 1 on the vertical axis ({maxgraph+10} and {mingraph-10}).

View 1 Replies

Flex :: Setting The Xml Dataprovider For Combo Box?

Nov 2, 2009

I am trying to get the drop down list of combobox by using a php file. That php file returns an xml string which has been used as data provider for combobox.I followed this thread too but in vain.DetailsI have set the creationComplete attribute of mx:Application to init(). In the init() function i have sent the following HTTPService

<mx:HTTPService id="interfaces" url="interfaces.php" resultFormat="e4x" method="POST">
</mx:HTTPService>
Combo Box:

[code].....

View 1 Replies

Flex :: Tooltip Placement Setting?

Dec 24, 2009

My flex app has various Custom components. I want the tooltips for all of them to show at the top-right corner.Is there a Application setting that I can do this with? Or do I have to do this at the component level.

View 1 Replies

Setting Up Functional Tests In Flex?

Apr 23, 2010

I'm setting up a functional test suite for an application that loads an external configuration file. Right now, I'm using flexunit's addAsync function to load it and then again to test if the contents point to services that exist and can be accessed.

The trouble with this is that having this kind of two (or more) stage method means that I'm running all of my tests in the context of one test with dozens of asserts, which seems like a kind of degenerate way to use the framework, and makes bugs harder to find. Is there a way to have something like an asynchronous setup? Is there another testing framework that handles this better?

View 3 Replies

Flex :: Setting Up Web Service Client?

Jun 1, 2010

I am new to Flex and needed some help setting up Web service client.I have a web service of method: public String printEchoStr(String str);I am facing problem while creating action script to call this service.I am getting error1067 : Implicit coercion of a value of type String to an unrelated ty generated. webservices:PrintEcho.I am not sure if this is the correct way.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:srv="generated.webservices.*"[code]...........

View 1 Replies

Css :: Setting AlternatingItemColors From Style (Flex)?

Jun 27, 2010

Hopefully simple question: I'm trying to set the alternatingItemColors on a datagrid via some values that I set in a CSS file but nothing seems to work. the CSS file looks something like this:

.FACS0 {color: #B0B0B0;}
.SACS0 {color: #A6A6A6;}
.AICS0

[code].....

View 1 Replies

Flex :: Setting Bounds For WindowedApplication

Jul 9, 2010

for some reason this flex 4 code gives me an error but I can't figure out why. In my WindowedApplication I have:[code]That seems like a bogus error since I can assign pref.bounds to rect without an error. I don't know why this isn't working. It works under flex 3 compatibility mode but that also breaks a lot of my spark components so I can't use it.

View 1 Replies

Flex :: Error While Setting Value Of Progress Bar

Mar 1, 2011

I want to set value of a progress bar in an accordion but I am encountering 'setProgress is not a function' error. If I move the progress bar out of the Accordion then the error goes away and the progress bar appears fine. I want to set the progress bar eventually to {repMonitor.currentItem.threatLevel} but for now I am just testing with hypothetical threat value i.e 60

<mx:Accordion id="monAccordian" includeIn="Monitoring" x="10" y="10" width="554" height="242" change="monAccordianChange()" >
<mx:Repeater id="repMonitor" dataProvider="{monitoringArray}">
<mx:Canvas width="100%" height="100%" label="{repMonitor.currentItem.firstName+' '+ repMonitor.currentItem.lastName}" >
<mx:Image x="10" y="10" source="{repMonitor.currentItem.imageName}" width="175" height="118"/>
<s:Label x="200" y="14" text="Threat Level:"/>
<mx:ProgressBar x="200" y="30" mode="manual" label="" id="bar" width="200" creationComplete="bar.setProgress(60,100);" />
</mx:Canvas></mx:Repeater></mx:Accordion>

View 1 Replies

Flex :: Setting Visibility Based On Slider?

Apr 6, 2012

I have an image gallery app that has a slider to control the width of the thumbnails that ranges from 80 to 1024. As you move the slider the thumbnails width changes to effectively scaling the image between 80px and 1024px. Below the thumbnail is some information about the image such as the name, size, dimensions, etc. There is also a set of icons that do various tasks (delete, edit, copy, etc). All of this information is located within a VBox.The problem I am having is I would like to have the VBox hide when the width of the thumbnail reaches 150 px or below. This I have been able to accomplish with the following code:

<mx:VBox visible = "{thumbnail.width &gt; 150}">The issue is that while the information within the VBox is now not visible, the real estate it takes up is not released. In other words, there is now a blank space the exact size of the VBox. What I'd like to do is to be able to release this space. I know this is probably something simple that I'm overlooking, but today my brain is just not working,

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved