Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Peter Nicolai Motzfeldt
RE: how 2 access custom AS3 objects through r [ reply ]  
2008-02-22 17:39
Hi

Now I have finaly got the time to get it right. See my blog at http://peternic.blogspot.com/2008/02/funfx-and-custom-components.html

Hope this helps!

By: fahad rao
RE: how 2 access custom AS3 objects through r [ reply ]  
2008-02-19 14:35
No problem.. thanks for the suggestion. ill try it out on my own and then get back to u on ur blog 'peter's to did'

cheers,
Fahad

By: Peter Nicolai Motzfeldt
RE: how 2 access custom AS3 objects through r [ reply ]  
2008-02-18 19:48
Hi, I am terible sorry about forgetting to answer.

I have not been able to get it right yet, but I have tried a couple of hours. But I think we should follow this example from Adobe (http://livedocs.adobe.com/labs/flex3/html/help.html?content=functest_components2_18.html). It is meant for QTP, but both FunFX and QTP build on the same thing.

I think you need to create some kind of itemrenderer so that FunFX has the ability to figure out which button you want to push.

By: fahad rao
RE: how 2 access custom AS3 objects through r [ reply ]  
2008-01-15 05:47
hey peter! belated happy new year!! any luck with the prob i asked?

By: Peter Nicolai Motzfeldt
RE: how 2 access custom AS3 objects through r [ reply ]  
2007-12-01 14:12
I am sorry about the late response.

I am not actually sure how this works. I will use this sunday to figure out how to do this and I will get back to you.

- Peter

By: fahad rao
RE: how 2 access custom AS3 objects through r [ reply ]  
2007-11-23 13:40
hi peter! thanks for the reply.

I have tried what you suggested and i am able to access button click, if my event listener is declared with in the

constructor of class object.

But If i have 2 buttons being displayed with in the class at seperate locations (each with their own specific event

listeners) then i am unable to access any of the buttons.

for example this is my action script class

package {


public class BtnExample extends UIComponent{

public var TButton:Button;
public var SButton:Button;

public function BtnExample(){
super();
configureLabel();
//global event listener
//addEventListener(MouseEvent.CLICK,clickHandler);
}



public function configureLabel():void {
//button width height x and y removed
TButton = new Button();
TButton.id='T';
TButton.addEventListener(MouseEvent.CLICK,clickHandler1);
SButton = new Button();
SButton.id='S';
SButton.addEventListener(MouseEvent.CLICK,clickHandler2);
TButton.label = "HELLO WORLD!";
SButton.label = "HOW ARE YOU?";
addChild(TButton);
addChild(SButton);

}


public function clickHandler(vent:MouseEvent):void
{
mx.controls.Alert.show('class object clicked pressed');
}


public function clickHandler1(vent:MouseEvent):void
{
mx.controls.Alert.show('btn 1 pressed');
}

public function clickHandler2(vent:MouseEvent):void
{
mx.controls.Alert.show('btn 2 pressed');
}
}
}


this is how i have declared an object of this class in my MXML FILE


<ns1:TextFieldExample id="classobj" x="10" y="10" height="611" width="489"/>


i am using this statement to access the class object in ruby

@ie.button("classobj").click #works if listener in action script class is uncommented.


My question is that i want to access both buttons individually in RUBY, is there some way to do that? what hirerachy

would be followed in above shown code?



By: Peter Nicolai Motzfeldt
RE: how 2 access custom AS3 objects through r [ reply ]  
2007-11-17 09:12
I think this works, have not tried it though. The framework relies on the fact that a Flex application is a hierarchy of components, either custom or predefined.

When you write for instance button("button_name").click in a Ruby script it does not actually need to be a button, but a Flex component that supports the event click.

I am not sure if this was comprehendable, but in short: as long as the component you have are in some way added as a child to the main mxml, it should work fine.


By: fahad rao
how 2 access custom AS3 objects through ruby [ reply ]  
2007-11-12 13:59
i have just started using funfx. I have been able to access predefined objects which are created in mxml i.e(text_input, button, datagrid e.t.c.)
My question is that can we access custom components defined in Action Script class and then declared in mxml file?
Basically i have made mxml application which has only one object defined in it (as an AS class). what i want to do is to access objects (i.e text_Area) defined in the Action Script class via ruby script.. is that possible or not??