[flexcoders] Native extension crashing

2011-12-21 Thread Tomislav
Hi,
I'm working on a native extension for Windows. I have a functional hello 
world example and I'm using Wouter Verweirder's ANT script for building and 
starting the app 
(http://blog.aboutme.be/2011/09/12/air-native-extensions-hello-world-example-ant-script/).

Now I wrote a C function in my extension interface that calls a C function from 
external dll. I have a C test that calls my external interface function and 
returns with success.

However, when I call that function from AIR I get an error message:
ArgumentError: Error #3500: The extension context does not have a method with 
the name doSomethingComplicated.

I learned by now that error above appears every time when something breaks in 
underlying dll (when I remove the call from my C function to second dll, 
recompile it and run from AIR everything works fine).

So I believe that there's something wrong between my ANE dll and the external 
dll I'm referencing.
External dll is packed inside ANE together with my dll.

Anyone had similar problem? Any hint appreciated.

Tomislav







[flexcoders] Re: hSlider Thumb Skin positions incorrectly

2011-12-21 Thread stldvd
Tom,

That's an excellent thought. I'm pretty new to spark skinning. I'll investigate 
this... hopefully it will be a relatively simple adjustment.

--- In flexcoders@yahoogroups.com, tkraikit tkraikit@... wrote:

 
 It looks like you're in a mobile app but trying to base your skin off of the 
 desktop HSliderThumb skin. Have you looked at using the mobile theme's skin 
 as your starting point instead?
 
 -- Tom
 
 
 --- In flexcoders@yahoogroups.com, stldvd stldvd@ wrote:
 
  ::bump::
  
  Anyone?
  
  --- In flexcoders@yahoogroups.com, stldvd stldvd@ wrote:
  
   Hi All,
   
   I'm trying to skin the thumb of an hSlider component. Problems: 
   1) the thumb is resized to be pixelated and grainy. 
   2) Its position is incorrect. Instead of the new button being cleanly 
   bisected by the track, it is just below the track, tangential to it. And 
   (presumably because its registration point is at upper left) when I slide 
   it all the way to the right, it goes  off the end of the track until its 
   left edge is at the track's right edge. This also messes up calculations 
   for the hSlider.value property. Here's code for the entire test project:
   //HSliderTest.mxml:
   ?xml version=1.0 encoding=utf-8?
   s:ViewNavigatorApplication xmlns:fx=http://ns.adobe.com/mxml/2009; 
 
   xmlns:s=library://ns.adobe.com/flex/spark 
   firstView=views.HSliderTestHomeView applicationDPI=160
 fx:Declarations
 !-- Place non-visual elements (e.g., services, value objects) 
   here --
 /fx:Declarations
   /s:ViewNavigatorApplication
   
   //SliderSkin.mxml. Only modified the s:Button tag at the end:
   ?xml version=1.0 encoding=utf-8?
   s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; 
   xmlns:s=library://ns.adobe.com/flex/spark
   xmlns:fb=http://ns.adobe.com/flashbuilder/2009; minHeight=11 
   alpha.disabled=0.5
   
   fx:Metadata
   ![CDATA[ 
   /** 
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
   [HostComponent(spark.components.HSlider)]
   
   ]]
   /fx:Metadata 
   
   fx:Script fb:purpose=styling
   /* Define the skin elements that should not be colorized. 
  For slider, the skin itself is colorized but the individual 
   parts are not. */
 
   static private const exclusions:Array = [track, thumb];
   
   /**
* @private
*/  
   override public function get colorizeExclusions():Array {return 
   exclusions;}
   
   /**
* @private
*/
   override protected function initializationComplete():void
   {
   useChromeColor = true;
   super.initializationComplete();
   }
   /fx:Script
   
   fx:Script
   /**
*  @private
*/  
   override protected function measure() : void
   {
   // Temporarily move the thumb to the left of the Slider so 
   measurement
   // doesn't factor in its x position. This allows resizing the
   // HSlider to less than 100px in width. 
   var thumbPos:Number = thumb.getLayoutBoundsX();
   thumb.setLayoutBoundsPosition(0, thumb.getLayoutBoundsY());
   super.measure();
   thumb.setLayoutBoundsPosition(thumbPos, 
   thumb.getLayoutBoundsY());
   }
   /fx:Script
   
   s:states
   s:State name=normal /
   s:State name=disabled /
   /s:states
   
   fx:Declarations
   !--- The tooltip used in the mx.controls.Slider control. 
  To customize the DataTip's appearance, create a custom 
   HSliderSkin class.--
   fx:Component id=dataTip 
  s:DataRenderer minHeight=24 minWidth=40 y=-34  
 s:Rect top=0 left=0 right=0 bottom=0
   s:fill
   s:SolidColor color=0x00 alpha=.9/
   /s:fill
   s:filters
   s:DropShadowFilter angle=90 color=0x99 
   distance=3/
   /s:filters
   /s:Rect
   s:Label id=labelDisplay text={data}
horizontalCenter=0 verticalCenter=1
left=5 right=5 top=5 bottom=5
textAlign=center verticalAlign=middle
fontWeight=normal color=white fontSize=11
   /s:Label
   /s:DataRenderer
  /fx:Component
   /fx:Declarations
   
   !--- The default skin class is HSliderTrackSkin. 
   @copy spark.components.supportClasses.TrackBase#track
   @see spark.skins.spark.HSliderTrackSkin --
   s:Button id=track left=0 right=0 width=11 height=11
 tabEnabled=false
 

[flexcoders] Re: getting the total of values of an array collection that is updated manually

2011-12-21 Thread ZIONIST
Hi guys, thanks to your help i have managed to get it to work finally. One 
question though, is this best practice? Below is the code.


?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=horizontal
xmlns:ns1=*
xmlns:ns2=as_logic.*
mx:states
mx:State name=dark
mx:SetProperty target={product}
name=text
value=Dark Chocolate/
mx:SetProperty target={price}
name=text
value=50/
/mx:State
mx:State name=spread
mx:SetProperty target={product}
name=text
value=Drinking 
Chocolate/
mx:SetProperty target={price}
name=text
value=100/
/mx:State
/mx:states

mx:Script
![CDATA[
import mx.events.FlexEvent;
import mx.controls.listClasses.ListData;
import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;

[Bindable]
public var orderColl:ArrayCollection=new 
ArrayCollection();

private function addProduct():void
{

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);

orderColl.addEventListener(CollectionEvent.COLLECTION_CHANGE, calculateSum);
}

public function deleteOrder():void
{

/*** Remove the item from the array collection 
***/
orderColl.removeItemAt(products.selectedIndex);

orderColl.addEventListener(CollectionEvent.COLLECTION_CHANGE, calculateSum);
}

/* public function changeQty(event:Event):void
{
var currentlySelectedItem:Object = 
products.selectedItem;
currentlySelectedItem.Qty =  qty.text;
}
 */

public function calculateSum(event:CollectionEvent):void
{
var amt:Number=0;
var n:int=orderColl.length;
for (var i:int=0; i  n; i++)
{
var 
cartEntry:Object=orderColl.getItemAt(i);
amt+=cartEntry.Qty * cartEntry.Price;
}
sum.text=usdFormatter.format(amt.toString());
}
]]
/mx:Script

mx:DefaultTileListEffect id=dtle0
  fadeOutDuration=300
  fadeInDuration=300
  moveDuration=650
  color=0xff/

mx:CurrencyFormatter id=usdFormatter
  precision=0
  currencySymbol=$
  alignSymbol=left/


mx:Canvas width=500
   height=300
mx:Label x=10
  y=10
  text=Milk Chocolate
  id=product/
mx:Label x=10
  y=36
  text=10
  id=price/
mx:Button x=10
   y=62
   label=submit
   click=addProduct()/
mx:Button x=10
   y=92
  

[flexcoders] .Net supported HTML5 through Visual WebGui

2011-12-21 Thread James Ong
It mean sense for Adobe to support HTML5 as well.


[flexcoders] It might be useful [1 Attachment]

2011-12-21 Thread Anchal Dwivedi



[flexcoders] Air Controlling InDesign?

2011-12-21 Thread grimmwerks
I know there's a few apps out there to control Photoshop and the like, but I'm 
wondering if anyone has any information as to how to go about it?  Trying to 
find out from the client exactly 'how' they want to control InDesign; I'd 
imagine calling a native process on a script for it...?


Garry Schafer
grimmwerks
gr...@grimmwerks.com
portfolio: www.grimmwerks.com/







Re: [flexcoders] Re: getting the total of values of an array collection that is updated manually

2011-12-21 Thread Alex Harui
Looks ok to me.  Is there some specific issue we should look at?  The 
expectation is that this is for a shopping cart and the number of items won’t 
be very big.  If you had 100,000 items, recomputing on every change could be 
slow, and then you might try to get smarter by looking at the event’s 
CollectionEventKind and making specific changes based on the kind.  For 
example, for an ADD event, all you need to do is add the new value to the old 
sum, no need to loop over everything.


On 12/21/11 7:35 AM, ZIONIST stinas...@yahoo.com wrote:






Hi guys, thanks to your help i have managed to get it to work finally. One 
question though, is this best practice? Below is the code.

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=horizontal
xmlns:ns1=*
xmlns:ns2=as_logic.*
mx:states
mx:State name=dark
mx:SetProperty target={product}
name=text
value=Dark Chocolate/
mx:SetProperty target={price}
name=text
value=50/
/mx:State
mx:State name=spread
mx:SetProperty target={product}
name=text
value=Drinking Chocolate/
mx:SetProperty target={price}
name=text
value=100/
/mx:State
/mx:states

mx:Script
![CDATA[
import mx.events.FlexEvent;
import mx.controls.listClasses.ListData;
import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;

[Bindable]
public var orderColl:ArrayCollection=new ArrayCollection();

private function addProduct():void
{

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);
orderColl.addEventListener(CollectionEvent.COLLECTION_CHANGE, calculateSum);
}

public function deleteOrder():void
{

/*** Remove the item from the array collection ***/
orderColl.removeItemAt(products.selectedIndex);
orderColl.addEventListener(CollectionEvent.COLLECTION_CHANGE, calculateSum);
}

/* public function changeQty(event:Event):void
{
var currentlySelectedItem:Object = products.selectedItem;
currentlySelectedItem.Qty =  qty.text;
}
 */

public function calculateSum(event:CollectionEvent):void
{
var amt:Number=0;
var n:int=orderColl.length;
for (var i:int=0; i  n; i++)
{
var cartEntry:Object=orderColl.getItemAt(i);
amt+=cartEntry.Qty * cartEntry.Price;
}
sum.text=usdFormatter.format(amt.toString());
}
]]
/mx:Script

mx:DefaultTileListEffect id=dtle0
  fadeOutDuration=300
  fadeInDuration=300
  moveDuration=650
  color=0xff/

mx:CurrencyFormatter id=usdFormatter
  precision=0
  currencySymbol=$
  alignSymbol=left/

mx:Canvas width=500
   height=300
mx:Label x=10
  y=10
  text=Milk Chocolate
  id=product/
mx:Label x=10
  y=36
  text=10
  id=price/
mx:Button x=10
   y=62
   label=submit
   click=addProduct()/
mx:Button x=10
   y=92
   label=Change State
   click=currentState='dark'/
mx:Button x=10
   y=122
   label=Drinking Chocolate
   click=currentState='spread'/
/mx:Canvas

mx:VBox width=340
 height=340
 horizontalAlign=center
 verticalAlign=middle

ns2:transparentList id=products
 width=300
 height=300
 dataProvider={orderColl}
 borderStyle=none
 itemsChangeEffect={dtle0}
ns2:itemRenderer
mx:Component
mx:HBox width=100%
 height=100%
 horizontalAlign=center
 verticalAlign=middle
 horizontalGap=0

 mx:Script
 ![CDATA[
 public function changeQty(event:Event):void
{
var currentlySelectedItem:Object = outerDocument.products.selectedItem;
currentlySelectedItem.Qty = qty.text;
outerDocument.orderColl.itemUpdated(currentlySelectedItem);
}
 ]]
 /mx:Script

mx:Image source=assets/trashcan.gif
  click=outerDocument.deleteOrder()/
mx:Label text={data.Product}
  styleName=orderLabel/
mx:Spacer width=100%/
mx:Label id=price
  text=${Number(qty.text)* Number(oldPrice.text)}
  styleName=orderLabel/
mx:TextInput id=qty
  width=30
  height=20
  text={data.Qty}
  change=changeQty(event)
  styleName=qtyInput/

mx:Label id=oldPrice
  text={data.Price}
  visible=false
  includeInLayout=false/

/mx:HBox
/mx:Component
/ns2:itemRenderer
/ns2:transparentList
mx:HBox
mx:Label text=Total:
  color=#FF
  fontWeight=bold/
mx:Label id=sum/
/mx:HBox
/mx:VBox

/mx:Application






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


[flexcoders] Re: getting the total of values of an array collection that is updated manually

2011-12-21 Thread ZIONIST
How do you do that?



[flexcoders] Ribbon control In flex

2011-12-21 Thread baskiram08
Hi
   I'm new in flex . any one tell me how to create the Ribbon control in 
flex4.0  above version (say any sample web site to build the control ) 

Thanks
Baski.



[flexcoders] Re: Native extension crashing

2011-12-21 Thread Tomislav
I made it working by putting the second dll in a folder that's part of windows 
system path.
Also, after exporting release build and installing it, application didn't work 
until manually copying the dll into same folder as exe file. 
The fact that it already exists in \META-INF\AIR\extensions\... subtree 
didn't help much.

It's far from perfect, but at least it works for development.
Hope this info can help someone.

Cheers,

Tomislav



[flexcoders] Re: Air Controlling InDesign?

2011-12-21 Thread Gmail Vane
Try look at adobe creative suite extension builder. The bad thing it's not 
free, but it provides api (swc libraries) for interacting with creative suite

Send from my ipod
Michal Szczepanski


Re: [flexcoders] Re: getting the total of values of an array collection that is updated manually

2011-12-21 Thread Alex Harui
Add a switch statement for event.kind, keep the last sum around, and modify it 
as appropriate.


On 12/21/11 11:51 AM, ZIONIST stinas...@yahoo.com wrote:






How do you do that?






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


[flexcoders] Adobe on Holiday

2011-12-21 Thread Alex H
Hi Folks,

Adobe's US Holiday break has started.  There may be little or no responses from 
Adobe until Jan 3.  I won't be going back over old messages so resend anything 
that needs attention on Jan 3.

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui