Flex :: How To Set Variables To False
Apr 4, 2010I am working in flex and I am just setting a variable to false. It doesnt do anything in the program but everything breaks when I put this line of code in:
somevar = false;
I am working in flex and I am just setting a variable to false. It doesnt do anything in the program but everything breaks when I put this line of code in:
somevar = false;
How do variables true/false custom variables work in flash?
For example, what I want to do is create a simple true=false variable that I can call on an if statement later.
For example:
Code:
Var1 = true;
if (!Var1)
{
[Code]....
I noticed that neither the "Var1 = true;" part or the if(!Var1) part worked in flash.
I am trying to display database details in a Flex datagrid and connected using HTTP Service. It was able to display details without any issue when I was working in the FlashBuilder 4.5, however, I deployed the bin-debug part in the Tomcat webserver to access it globally.
I am experiencing this error message when I am trying to access the swf file "HTTP request error Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]. URL: http://localhost:8084/UA/details.jsp"
I tried to create the crossdomain.xml file and deployed in the root directory but still experiencing the same error.Here is my crossdomain.xml :
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>[code].....
I've read the flex language reference: [URL]. This property is true if execute() has been called and not all of the results have been returned from the database. However, I'm having trouble understanding what that means exactly. I keep receiving an error:
Error #3106: Property cannot be changed while SQLStatement.executing is true.
I've tried creating an event handler for SQLEvent.RESULT, my thinking was that's how the results would get returned from the database and therefore executing() would return false - didn't work. Does this mean i'm trying to change my SQLStatement variable too quickly? how long does the execute() function take?
The code in question:
private function fileProgress(p_evt:ProgressEvent):void {
var char:String;
var line:String = "";
var counter:int = 1;
sqlStatement = new SQLStatement();
[Code] ....
Stream is a filestream. I'm trying to read a textfile and put every line into a new sqlite table row. I've also tried using sqlStatement.parameters as an alternative way to do my insert queries, but to no luck. that throws a different error:
Error #3110: Operation cannot be performed while SQLStatement.executing is true.
I've found that if I use the CursorManager to set a cursor ursorManager.setBusyCursor() — then set stage.mouseChildren = false, the cursor set by CursorManager is replaced by the "default" mouse cursor the next time the mouse is moved. I'm setting stage.mouseChildren = false so that, while the mouse is being dragged, other "stuff" on the stage won't get mouse events (eg, so that mouse-over affordances aren't triggered if I'm in the middle of a drag).
View 1 RepliesI've got a tileList in a Flex 3 website. I want to programmtically turn off the visibility of a tile. So for example[code]...
View 2 RepliesThe following simple codes show how I'm trying to keep white space in my XML but it doesn't work! what I'm doing wrong here? (note the space before 'world!'
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
[code]....
It would be an easy question, but property 'selectable' is set to 'false' and therefore selectedItem is always null.
In each row I have 3 buttons. When I click a button, I need to extract data corresponding to clicked row.
How do you make the childAllowsParent property of an SwfLoader go from false to true, that is, how as a parent application do you set up security to make the child app's events and other properties accessible to you. To read the flex docs on this, one would think nothing could be simpler:
"This property [childAllowsParent] is set to true if the child object has called the allowDomain() method to grant permission to the parent domain or if a URL policy is loaded at the child domain that grants permission to the parent domain. If child and parent are in the same domain, this property is set to true . [emphasis added]" So, I'm in a development environment and want to load an swf from my own system via an SWFLoader and then be able to monitor its events within the parent app.
[Code].....
I have a Spark Component (a Group) which doesn't behave as wanted.The tooltip is only shown when the component is enabled=true which the following example shows:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"[code]/....
In the Halo component the toolTip is shown. And this is, what I want to achieve.In my case I want to try something like this:
<s:Group toolTip="{cartEntries > 0 ? 'great!' : 'go and buy!'}"></s:Group>
I have a code similar to this:
<s:VGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="label" />
<s:TextInput id="rmName"/>
[Code].....
I want that the s:VGroup container has the height only of its visible children. In this example there is a free space even the visibility mx:HorizontalList is set to false. Every time I change the visibility of the child element I want that the parent (s:VGroup) will change his height. How to do this in flex?
If you know Flex, you probably know what the property "includeInLayout" does. If not, this property make the parent of your component disregard the bounds (like width and height) of your component in render their own bounds.Description in reference below:
Specifies whether this component is included in the layout of the parent container. If true, the object is included in its parent container's layout and is sized and positioned by its parent container as per its layout rules. If false, the object size and position are not affected by its parent container's layout http:[url]...
In Flex, for example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"[code3]...............
i try to toggle tabBarvisible = true/false with the following code:
protected function textArea_clickHandler(event:MouseEvent):void
{
if (tabBarVisible="true") {
[Code]....
but only can get tabBarvisible="true" and when i click again nothing happen. the tabBarvisible won't turn to "false".
In Flex I've got a component, which is based on a Canvas.It looks like this (I removed the <mx:Script> for better reading):
<mx:Canvas verticalScrollPolicy="off" showEffect="showFX" hideEffect="hideFX" horizontalScrollPolicy="off" creationComplete="doComplete()" xmlns:mx="http://www.adobe.com/2006/mxml" width="63" height="63">[code]....
If I set customComponent.Visible to false, the component gets hidden (as expected). But doesn't trigger the hideFX at all. Am I doing something wrong? Or isn't this the correct way to use hideEffect and showEffect?
i have a tabbar with 10 button. when i change the some buttons visible and includeInLayout property false then tabbar size is not change..it is same as when it has 10 button
View 1 RepliesSelectedcolor, true to the text true or false is false text into print.colorPicker component in, I select Export to a selected color, the color value myMC texte into summer, but accuracy can not control.
var myColorPicker:ColorPicker = new ColorPicker();myColorPicker.editable = false;myColorPicker.visible = false;myMC.visible= false;myColorPicker.addEventListener(MouseEvent.CLICK, clickHandler);myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler);[code].........
In datagrid i shows number of checkbox for example 20 checkboz ,in 20 checkbox if i select any 15 checkboxs then remining checkboxs will be disable (enabled="false" But 15 selected checkbox accessable ?
How can i do that . i tried
<mx:DataGrid id="dg" width="100%" height="100%" rowCount="5"
dataProvider="{dp}">
<mx:columns>[code]...
I've got a component written for my app by a third party developer and am trying to integrate it, but I've found a bug that seems like it's either a compiler bug, or there's something with how Flex and static variables work that I wasn't aware of.Basically, I have this:
public class ModeChangeController {
public static const DISPLAY_MODE:String = "DisplayMode";
}[code]...
If I use //V2 (i.e. comment out V1), a bug occurs at the startup of the application (some TextFields are uneditable and contains no text), but with //V1 and not V2, it works fine. If I comment out both, that also works fine (I don't get the TextField bug).It took me a while to figure out that it was that static const String that was causing the issue, but I'm still not sure why or if there's something I can do about it except for just moving the DISPLAY_MODE to Events (which is what I've done at the moment, but it's not a particularly nice solution).There are no errors in the log. The order of the includes in my BorderContainer code doesn't matter. I've googled for "as3/flex static initialization order" but haven't found anything.
Clarification: showInitialView() never gets called. It doesn't get there before the other bug shows up. Just having the V2 line there causes the problem.
Update: I've fixed my problem with the TextInput strings not showing: Turns out that adding the component caused the Tahoma font to not show up. However, setting the font-weight to bold fixed that problem, or switching to Arial. With that said, the original question still stands, because when I ran it without V2, it found Tahoma with normal font-weight.
how to describe this without confusing everyone but basically, i have:
prevslot = "jslot"+historynum+"full";
historynum is a dynamically gathered number from another part of my code. it will be like 1 or 2 or 3 etc.
The problem is that i want to like set the value of that variable to false, so for example if historynum was equal to 1, the value of prevslot would be jslot1full. I need to set the value of prevslot to false, i tried prevslot = false; but obviously that just sets prevslot to false, not the value of prevslot. Is there any way to set the value of prevslot to false?
How would i do stage.showMenu=false in as3 iv looked on google found nothing just some fullscreen flash stuff im not interested with at the moment and iv searched this site but got nothing.so as2 code:
stage.showMenu=false;
As3 code:
I have a webpage with a video component (swf file) with a separate .flv file and skin. The .flv file is intended to progressively load from the webserver.
In the swf file I have set autoplay=false to stop the move playing when the page is loaded. This works fine.
However, the problem is that the movie still downloads in the background. i.e. Each time the page is loaded, the .flv file is being loaded.
Is there a way to stop the .flv file being loaded until the Play button is pressed in the player?
Basically what i have is three buttons which can be pressed in a maximum of 7 different combinations. Each of these buttons has a movieclip underneath that advances to the next frame when the button is pressed. Each clip has two frames with actions, frame 1 has:
stop();
var option1:Boolean = false;
and then frame 2 has:
stop();
var option1:Boolean = true;
So when you press a button you have true, and false when the button is pushed again.
i already have a constant loop between frames 2 and 4. At frame 4 i think i need to have some code that detects which state the 3 boolean statements are in and then load a movie depending on which statements are true and which are false.
So, I'm getting this error when trying to load a URL with HTTPService.
[FaultEvent fault=[RPC Fault faultString="A URL must be specified with useProxy set to false." faultCode="Client.URLRequired" faultDetail="null"] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]
[code].....
how do i test if a hittest is false
View 1 RepliesI'm triyng to get the browsers back-button to work with my flash site. The general principle is this:There is an index.html page containing an (not yet) hidden Iframe and the flash movie.The Iframe contains page A, which starts with JavaScript calling a BACK-function on the index-page.The BACK-function triggers an AS-function in the flash-movie that activates its own back-button, and then changes the URL of the Iframe to Page B. This causes a new History to be added to the browser.The flash movie now contains 5 frames (labeled in the middle of the stage) and two navigation buttons: back (Terug) and forward (Verder). Those buttons do exactly what you'd expect them to do (prevFrame and nextFrame).On a PC (IE) this seems to work pretty well. But on a mac nothing seems to work propperly.Here's the code I have on the first frame.
stop();
_root.terug.onRelease = function(){
prevFrame();
[code].....
I never get the hang of these.'
Code:
_global.web_link_activate = (wArray[this.id]);
if (_global.web_link_active == "no"){
_root.load_area.zoomer.enabled = false;
_root.load_area.zoomer._alpha = 20;
[Code] .....
That should work but it does not. it always says "yes" wArray is a drawn from an xml document.
XML is
Code:
weblink="yes"
Can I set vars like true and false in xml kinda like weblink=false??
I'm a little bit stuck as to why gotoURL would return false and does nothing. Does anyone know what could possibly cause gotoURL to return false? submit is a MC. The trace works fine. It's just the gotoURL doesn't take you any where.
Code:
submit.onPress = function()
{
[code].....
I've got a SWF that I'm loading, and wanting to get reference to a class contained in it's library.My FLA contains one item in the Library, Export for ActionScript and Frame 1 checked. I have nothing on the stage, and no Document class specified. Targetting FP10.I'm trying to track down whether this is related to the applicationDomain or how I have my FLA set up.
View 6 RepliesHow does one go about setting a dynamic text field to false?
View 2 RepliesSo, if the condition is false, which would be faster:
Code:
if(condition)
while(condition)
[code]....