Posted by @st@l@vist@ in SWF Studio V3 on Mar 06 2008, 12:12 pm

Is it possible generate pseudo-intrinsic classes for SWFStudio AS3 API?
Now we have only AS2 intrinsic classes.


Posted by mbd in SWF Studio V3 on Mar 06 2008, 12:49 pm

Check out: Getting Started > AS3 Class Definitions

Include the SWC in your Library or in your classpath.


Posted by @st@l@vist@ in SWF Studio V3 on Mar 06 2008, 01:12 pm

I'm not about that :)

I need pesudo-intrinsic classes in FlashDevelop (+ Flex SDK) for the AutoComplete.

I don't know, I must do it himself, or you have an opportunity to generate it in the future.


Posted by mbd in SWF Studio V3 on Mar 06 2008, 02:05 pm

FlashDevelop can't work with SWCs? That's how Flex Builder does its AutoComplete/codehint.

Does that mean FlashDevelop doesn't give codehinting for the built-in classes, like flash.display.MovieClip?


Posted by @st@l@vist@ in SWF Studio V3 on Mar 06 2008, 02:36 pm

FlashDevelop can use SWC as intinsic library. It's good for NorthcodeAS3Lib.swc, but when I try to use coreAS3Definitions.swc ...

I want to get ssCore.App instead northcode.swfstudio.v3.childObjects.ssCore.AppClass.

For flash.display.MovieClip, FD used intrinsic classes, like yours AS2 classes.

package flash.display 
{
    public dynamic  class MovieClip extends Sprite 
    {

        public function get currentFrame():int;
        ...
    }
}


I can't be sure, I'm begginer for FD. :)


Posted by @st@l@vist@ in SWF Studio V3 on Mar 07 2008, 07:02 am

Perhaps I'm doing something not right?

I downloaded and installed a trial version of FlexBuilder3 and here's the result:

http://www.northcode.com/forums/attachment.php?attachmentid=1374&d=1204891076

Here's the same result in FlashDevelop:

http://www.northcode.com/forums/attachment.php?attachmentid=1375&d=1204891111

In Flash CS3 we have another result, but it's done through CustomAction:

http://www.northcode.com/forums/attachment.php?attachmentid=1376&d=1204891128

attachments: flexbuilder3.gif   flashdevelop3.gif   flashcs3.gif  


Posted by mbd in SWF Studio V3 on Mar 07 2008, 10:36 am

You're typing three different things.

"ssCore." should give you codehinting in Flash CS3 and Flex Builder 2/3.

"ssCore.App." should also give you codehinting.

"northcode.swfstudio.v3.types.ssCore." will list the input and output object types. This isn't documented yet, but what that does is provide a way to pass/receive fully typed objects for V3 commands.

So, for showMsgBox:
import northcode.swfstudio.v3.types.ssCore.*;

var asi:App_showMsgBox_IN = new App_showMsgBox_IN();

Then typing "asi." will display the input parameters for ssCore.App.showMsgBox. You then add the parameters (properties) you want and pass that to the command:
asi.prompt = "Hello";
asi.title = "This is the title";

ssCore.App.showMsgBox(asi);

It works the same for return objects:
var aso:App_showMsgBox_OUT;

aso = ssCore.App.showMsgBox(asi);

if (aso.success)
{
   ssDebug.trace("You pressed "+aso.result);
}
else
{
   ssDebug.trace("ERROR: "+aso.Error.description);
}


There's a type for every ssCore command. That includes a CallbackObject, ErrorCallbackObject, and ErrorCallbackReturnObject. The Error property on the return object is of type ErrorReturnObject.

Parameters for callback functions can be typed as generic objects (Object) or use these special return types. For example:
function onAnswer(r:App_showMsgBox_OUT, c:CallbackObject, e:ErrorCallbackReturnObject):void
{
   if (aso.success)
   {
      ssDebug.trace("You pressed "+aso.result);
   }
   else
   {
      ssDebug.trace("ERROR: "+e.description);
   }
}

var asi:App_showMsgBox_IN = new App_showMsgBox_IN();
asi.prompt = "Hello";
asi.title = "This is the title";
ssCore.App.showMsgBox(asi);

Of course you don't have to do it like this, but some people prefer to have everything typed. Plus, in Flex Builder you get codehinting for each object. These types are available in Flash CS3 as well, since it's the same SWC, however you won't get codehinting for them.

In Flash we have no choice but to use the XML codehinting files (for which I could rant for hours). The one good thing in Flash's codehinting is that because you dictate the content through written text you can have multi-line text, which we use to display input and output parameter info.

FlashDevelop allows this multi-line support through comments in your classes in the 3.0 beta, which is the version that supports AS3. We don't officially support FlashDevelop but I'll give it a try and if I see a problem I'll see if there might be something easy that can be done.


Posted by AGo in SWF Studio V3 on Mar 07 2008, 11:32 am

Derek, if you need anybody to test some FD stuff let me know, I use it since pre-release.

But as already said, FD's codehinting bases on intrinsic classes which ship with FD, to be found in %FlashDevelop%\FirstRun\Library\\intrinsic

they do not use the SWCs directly.


Posted by @st@l@vist@ in SWF Studio V3 on Mar 07 2008, 11:37 am

Oh, "northcode.swfstudio.v3.types.*" is great thing! :clap:
This will help me in the work.

I'm not trying to show different things.
Only that FlashDevelop and FlexBuilder see the library.
But I don't see codehint for "ssCore.App." neither in FlexBuilder nor FlashDevelop.

This works only in Flash CS3, thanks CustomAction's XML.

In any case, quite simply generate pseudo-intrinsic classes for FlashDevelop from CustomAction's XML.


Posted by @st@l@vist@ in SWF Studio V3 on Mar 07 2008, 11:56 am

AGo, but FD can work with SWC for AutoComplete. (see attached file)
The problem is that coreAS3Definitions.swc has a complex architecture.

+ FlexBuilder works with NorthcodeAS3Lib.swc well as FlashDevelop.

attachments: flashdevelop3.2.gif   flexbuilder3.2.gif  


Posted by mbd in SWF Studio V3 on Mar 07 2008, 12:25 pm

You don't see anything in Flex Builder 3 when you type "ssCore."? Or just "ssCore.App."?

And the SWC is included in the Library in Project Properties?


Posted by @st@l@vist@ in SWF Studio V3 on Mar 07 2008, 12:38 pm

Nothing :(

Perhaps it's because ssCoreClass defined as private?
I see codehint for ssScript, but not for ssCore ...

attachments: fb3.1.gif  


Posted by @st@l@vist@ in SWF Studio V3 on Mar 07 2008, 08:47 pm

mbd, If you will allow, I have two offtopic question:

1) Private classes and constructors isn't allowed in AS3, I'm wrong? As you could? :)
2) May be in the future you add to API some constants?
For example Registry_rooKey.HKEY_CURRENT_USER, App_showMsgBox_Icon.CRITICAL, etc :quiet:


Posted by mbd in SWF Studio V3 on Mar 08 2008, 02:50 pm

The reason that you aren't getting codehinting for ssCore, ssGlobals, ssDefaults, ssDebug, and ssKey is that there seems to be something wrong with either how I've built the SWC or Flex Builder 3 and codehinting for SWCs.

I quickly duplicated a very simple version of ssCore and the App class with just class files and that worked in FB3. So the technique I used to get the codehinting to work seems to work as class files but not in an SWC. I still need to do a little more testing to see if it's really a problem with FB3 (since FB2 doesn't have this issue) or if I've done something wrong in building the SWC.

1. It is true that private constructors are not allowed. However, classes can still be private, or internal, to a package file. ssCoreClass is not defined as private but internal, and that should have no impact on codehinting, but it's worth looking into.

2. That's a good idea. There are places where constants would be appropriate and easy enough to add. We'll add it to the wishlist.


Posted by @st@l@vist@ in SWF Studio V3 on Mar 08 2008, 10:13 pm

Yes, class definition can use four attributes: "public", "internal", "dynamic" and "final".

But in FD I see your ssCoreClass as "private" (It's fifth attribute, ABCDump confirmed this). I was able to reproduce it :)

For the first case, you don't get codehint:
Two classes in a single file, the internal class "MyPrivateClass" placed outside of package.

MyPublicClass.as
package my_package
{
    public class MyPublicClass
    {
        public function MyPublicClass()
        {
            var p:MyPrivateClass = new MyPrivateClass;
        }
    }
}

internal class MyPrivateClass
{
    function MyPrivateClass()
    {
    }
}
As result:
<font color='Red'>class private::MyPrivateClass extends Object
{
  function private::MyPrivateClass():*
  {     
  }
}</font>
In the second case, everything works fine:

MyPublicClass.as
package my_package
{
    public class MyPublicClass
    {
        public function MyPublicClass()
        {
            var p:MyPrivateClass = new MyPrivateClass;
        }
    }
}
MyPrivateClass.as
package my_package
 {
     internal class MyPrivateClass
     {
        public function MyPublicClass()
        {
        }
     }
 }


Posted by @st@l@vist@ in SWF Studio V3 on Mar 09 2008, 10:11 am

But for me remain a mystery way to create a code such as your "ssCore:private::ssCoreClass" :)

Perhaps this can be achieved so?

package
{
    public const TopLevel:TopLevelClass = new TopLevelClass();
}

class TopLevelClass
{
    function TopLevelClass()
    {
    }
    public function init():void
    {
        trace("I'm TopLevelClass");
    }
}


And yet added :)

Unfortunately, FD don't see top level definitions in the SWC. But this issue can be partly resolved for current version of the "coreAS3Definitions.swc" as six lines in FlashDevelop\Library\AS3\intrinsic\toplevel.as:

public const ssCore:ssCoreClass;
public const ssDebug:ssDebugClass;
public const ssDefaults:ssDefaultsClass;
public const ssEvents:ssEventsClass;
public const ssGlobals:ssGlobalsClass;
public const ssKey:ssKeyClass;

[LEFT]
[/LEFT]


Posted by @st@l@vist@ in SWF Studio V3 on Mar 12 2008, 07:59 pm

mbd, I understand that this is undocumented yet, but I would like to ask ...
For all input and output objects, Boolean values now typed as String?

For example:
 // only String
northcode.swfstudio.v3.types.ssCore.Win_setDraggable_IN.flag = "true"
// Can be Boolean or String
ssCore.Win.setDraggable({flag:true});


It is unusually :)

[Edit] Any types represented as String


Posted by eestes1 in SWF Studio V3 on Nov 26 2008, 12:38 pm

I also do not get code hinting for ssCore, etc. I've installed the swc's from the most recent update. Was there a workaround that i did not find? last i see is mdm saying something is weird in the swc. Is there any way to get the classes to directly link to? Thanks -Ethan


Posted by mbd in SWF Studio V3 on Nov 26 2008, 01:01 pm

Did you see @st@l@vist@'s workaround 2 posts up?

QUOTE:

Unfortunately, FD don't see top level definitions in the SWC. But this issue can be partly resolved for current version of the "coreAS3Definitions.swc" as six lines in FlashDevelop\Library\AS3\intrinsic\toplevel.as:

ActionScript Code:

public const ssCore:ssCoreClass;
public const ssDebug:ssDebugClass;
public const ssDefaults:ssDefaultsClass;
public const ssEvents:ssEventsClass;
public const ssGlobals:ssGlobalsClass;
public const ssKey:ssKeyClass;


Posted by eestes1 in SWF Studio V3 on Nov 29 2008, 11:36 pm


QUOTE: from mbd;46017
Did you see @st@l@vist@'s workaround 2 posts up?

Yes, but I'm running flexbuilder 3 on the mac, not flashdevelop. I read that as a FlashDevelop specific solution. Am I wrong on that.

Thanks for any insight you have -Ethan


Posted by northcode in SWF Studio V3 on Nov 30 2008, 01:32 am


QUOTE:
Yes, but I'm running flexbuilder 3 on the mac, not flashdevelop. I read that as a FlashDevelop specific solution. Am I wrong on that.

If you revive an 8 month old post about Flash Develop, and say you're having the same problem then we're going to assume (as Derek did) that you were working with the same setup but that you were just too lazy to read the whold thread to find the solution.

If your problem was different from the one @st@l@vist@ was talking about then you should have started a new thread and told us about your development environment. The more we know about your situation the better we can help.

We haven't tested with Flex Builder 3 or Flash CS4 yet so we can't say anything for sure what the problem is yet, but we haven't seen an upgrade of Flash or Flex yet that didn't cause us some problems :)


Posted by eestes1 in SWF Studio V3 on Nov 30 2008, 12:28 pm


QUOTE: from northcode;46033
If you revive an 8 month old post about Flash Develop, and say you're having the same problem then we're going to assume (as Derek did) that you were working with the same setup but that you were just too lazy to read the whold thread to find the solution.)

Okay, the reason I posted to this thread was because you were dealing with FB3 and FlashDevelop on this issue:

"The reason that you aren't getting codehinting for ssCore, ssGlobals, ssDefaults, ssDebug, and ssKey is that there seems to be something wrong with either how I've built the SWC or Flex Builder 3 and codehinting for SWCs.

I quickly duplicated a very simple version of ssCore and the App class with just class files and that worked in FB3. So the technique I used to get the codehinting to work seems to work as class files but not in an SWC. I still need to do a little more testing to see if it's really a problem with FB3 (since FB2 doesn't have this issue) or if I've done something wrong in building the SWC."

So this is why I asked if it's possible to get the class files rather than an swc that seems to have issues in FB3. It seems to be an issue with the swc across the board and not specific to one ide.

Is there an eta on looking into the swc issue-if the class files are not available outside of the swc (do to needing to protect your intellectual property)?

Sorry if my posting has offended but it seemed messy to start a new thread about an issue that already had a thread in place.


Posted by northcode in SWF Studio V3 on Nov 30 2008, 07:54 pm

We weren't offeneded at all! And I wasn't attacking you, just pointing out that in the absence of facts we're going to make assumptions based on context and we aren't always right :)

The classes we put in the SWC are all generated so there's nothing special about them. That's one reason our stuff doesn't break when we have to make changes, our API is so standardized that it's basically just a shell around the core player.

We could distribute the classes as source but it complicates the installation and management for multiple different products where a single SWC is nice and easy, when it works :)

We're going to quickly look into why the SWC doesn't work, but if it's too much trouble then we'll have to reconsider distributinig them as a set of classes like we did for AS2.