Flex :: Call Function When Dataprovider Changes?
Feb 6, 2011How can I set a function to be called when the length of a DataProvider changes?
View 2 RepliesHow can I set a function to be called when the length of a DataProvider changes?
View 2 RepliesI have a function in Flex which has three function in it.
public function update():void
{
A(); \Dispatches a event with Remote Call
[code].......
I have an AS3 program that calls a function multiple times. The function must return multiple variables, so I created a class for the function to declare an object containing all of these variables. For example, here's my class:
package
{
public class PER
{
[Code].....
Let's say the calling program calls the function, which returns the variables into data_set1 (where data_set1 depends on input variables arg1, arg2, arg3) using:
var data_set1:PER = function_name(arg1, arg2, arg3);
The calling program does some stuff, then calls the function again, but returns the variables into a new variable name, data_set2:
var data_set2:PER = function_name(arg4, arg5, arg6);
My intention is that data_set1 and data_set2 are different (e.g. not linked together).
My question is, given that arrays are passed by reference, will data_set1 be modified to agree with data_set2 upon the 2nd function call? Why or why not?
I want to call an App function inside a (I know about the Component scope already).What I mean is this:
<mx:Script>
<![CDATA[
public someFunction():void {
[code]......
I have a component that I hand over a function
public var func : Function;
Now the function is a function that has parameters in its signature
public function myFunction(s : String) : void {
doSomething(s);
}
from my component I can call the function with
func.call();
how to invoke the function with its parameters?
How can we dynamically call a fuction. I have tried below code:
public function checkFunc() : void
{
Alert.show("inside function");
[code]......
So, I create standard AS3 flex project. In constructor goes only start();
rest of functions are basically this:
private start():void { f1();}
private function f1():void { f2();}
private function f2():void { f1();}
And it's standard recursion. SWF either breaks or loops as many times as I tell it. One f calls the other, which calls first... I do not want that.
I want f1 to do some stuff, calls f1 and closes itself. Than f2 works, calls f1 and closes. And so on.
Like having 2 sets of code that loops through.
What's the cleanest way to do that?
I create standard AS3 flex project. In constructor goes only start();
rest of functions are basically this:
private start():void { f1();}
private function f1():void { f2();}
private function f2():void { f1();}
And it's standard recursion. SWF either breaks or loops as many times as I tell it. One f calls the other, which calls first... I do not want that. I want f1 to do some stuff, calls f1 and closes itself. Than f2 works, calls f1 and closes. And so on. Like having 2 sets of code that loops through.
I have a Flex 3.4 app that embeds a swf with mx:SwfLoader...
That swf has a public function named "playIt". I've tried dispatching events to gettingHere.content, casting gettingHere.content as a MovieClip and other stuff...
var swfApp:MovieClip = MovieClip(gettingHere.content);
if (swfApp.hasOwnProperty("playIt")) {
var helloWorld:Function = (swfApp["playIt"] as Function);
helloWorld();
}
I want to call the parent function called "edit_groups()" from the itemRenderer. The code for my itemRenderer is:
<mx:VBox id="vbx_container" paddingBottom="4" paddingLeft="4" paddingRight="4" paddingTop="4" borderStyle="solid"
dropShadowEnabled="true" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
<mx:Canvas width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
<mx:Image id="image" width="100" height="100" source="{data.thumb}" scaleContent="true" maintainAspectRatio="true"
complete="{image_smoothing_handler(event);}" trustContent="true" doubleClick="{Call The Parent Function"edit_groups()"}"/>
</mx:Canvas></mx:VBox>
And I call my itemRenderer from an application like:
list_groups_modify.itemRenderer=new ClassFactory(groups.list_groups_modify_item_renderer);
<mx:Label text="{data.label}" textAlign="center" maxWidth="60" toolTip="{data.label}"/>
Is it possible to call the function by using the datagrid column item?I want to call the function while the user click the particular column item in the datagrid?
View 1 RepliesCan I call a function when building an array in Flex 3?
public function gridBuilder(myArray:Array):void {
var i:uint;
for (i=0; i<myArray.length; i++){
[Code]....
MyArray is the result of a remote call to the database. I then prepare the array to be used in a dataGrid. I also want to call a function that provides a grade. Unfortunately, my function appears to be called only once. Is it possible to call a function when you're building an array? see the "Grade:" bit.
I create a swf with flex. Than I embeded that swf into aspx page.But how can I access/invoke/call swf function from asp.net???
View 1 RepliesIs it possible to call a child function from within the parent? I know to go child > parent, you can do parentApplication.functionName(parameters);, but what about going the other way... that is parent > child?
View 2 RepliesIs it possible to call a function in flex from the php side of AMFPHP?
For instance, and error is thrown in php, can i "listen" for it in the flex app?
I have a function I wrote that gets the height of the application without scrolling. Meaning the height it would need to be to not have to scroll.
[Code]...
This function works well but the problem is knowing when to call it. I planned on calling it after I add/remove any children from it. However thats still too soon because I don't get the correct height yet if I run it then. The fix I currently have is using a Timer to call the function about 300 milliseconds after a child is added/removed which seems to work well but I think this is a very risky fix. So I was wondering a better solution. I am thinking there has to be some sort of event I can listen for that will tell me when its ready for me to run this function, I just don't know what event that would be?
I was wondering if flex has some events that can call before I close the whole application or close browser. Since I would like to send a httpservice to a php before the swf is closed. I tried this before:
<mx:Application xmlns:mx="" creationComplete="init()" remove="clearHistroy()">
But it didn't work.
I need to call a varargs function:
function doSomething(... args): Object {
// do something with each arg
}
However, I'm building the arguments for this dynamically:
var someArgs: Array = ['a', 'b', 'c'];
doSomething(someArgs);
The problem is, when I call the function in this way args ends up being a 1-element array with someArgs as the first element, not a three-element array.How can I call doSomething with someArgs as the argument array?(For the search engines, this is argument unpacking)
I'm using Flash Builder 4 Beta 2. I have it connecting to a PHP service. The way I set this up was using the wizard, so I didn't actually write the code to connect to it.[code]...
One of the functions that I'm calling fetches users from a MySQL database. There are about 30,000 users right now. The service seems to timeout when fetching more than around 22,000 rows, I get the "Channel Disconnected before an acknowledgement was received" error. If I call the PHP script from a browser, it fetches them all with no problems at all, however. I have tried increasing the timeout in the PHP script (which didn't work), but obviously this isn't the problem since the browser is able to pull them up with no problems.
i want to call an external function inside a class. thats the code;
in checkConnectionStatus function,
this[_funcNameForSucceededCon].apply(); doesnt work because "this" is the class, not the Application. How can i reach Application at this time or what can i do?
package myLibrary
{
import air.net.URLMonitor;
import flash.events.Event;
[Code]....
For some reason, the ExternalInterface.avaiable shows true, but it won't call alert(). Can anyone shed some light to this problem?
private function checkEI():void {
eiStatus = ExternalInterface.available.toString();
ExternalInterface.call("alert", "hi");
[code].....
I have created a quiz app using XML.
My XML code:
[Code]...
How can I access the current radio button to validate this answer?
I want to call a function in main flex app from the custom preloader code in actionscript before it dispatches complete event. Also i want to know how to call back to a function in preloader code from application
View 1 RepliesHow do I call a custom component's public function from the main app. For example, I've got a timer component, MyTimer.In the main app, I want to call startTimer() or stopTimer().In the main app, I've got:
<visualcomponent:MyTimer />
In the component, I've got:
public function startTimer():void {
[code].....
i write a sound playback class that stop the older sound and play the new sound.After that i need an extra method in this class that trigger when the sound play is complete.I successfully achieve this, but i need to inform the main app (main.mxml) about the completion of that sound playing.
here is my sound playback class.
package com.m2b.data
{
import flash.events.Event;
import flash.media.Sound;
[Code]....
Im trying to create a loop of items like this...
for each (var btn:Object in ViewButtonData)
{
// build element[cocde]..........
I would like to pass in current HBox to the 'HoverTab' function. Is there a way to do that?
I know there are ways to invoke javascript inside the html wrapper template for the flex application using ExternalInterface, but is it possible to reference an external html page?
View 3 RepliesI'm having a problem in flex 3 where if a static const I have defined is used as the parameter to a function call within binding tags I get a "1120: Access of undefined property NodePropertyMatrix". _propMtx is a ArrayCollection.
[Code]...
I've a grid view in flex, one of the columns is rendered like this:
[Code]....
now I've a problem that the function in button click is not being recognized. It says "call to a possibly undefined function" even though it was defined. What is wrong with this? How do i make a button in a grid call a function in the same mxml file??
I have a main application that contains a list, using a custom itemRenderer to display data.
I would like to be able to call a function, inside the itemRenderer, from the main application.
When running the app, we have a list with three persons, and a button. I want to call the function myItemRendererFunction() inside the itemRenderer, of the selected item in the list, all this, from the main app.
[Code]...