Class exclusion in AS3 in Flash IDE

Hi,
I've been looking high and low for a way to exclude class
file from compiling into a swf on publish, similar to the
functionality available when publishing AS2 apps (outlined here:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000817.html).
I've found references on how to do this when compiling with
the command-line compiler (detailed here:
http://www.bit-101.com/blog/?p=941),
but so far I've haven't been able to find anything that details how
to do this in the IDE.
I'm hoping someone here might have an answer. I'm going to
change my approach to a number of applications if I can't find an
answer to this.
Thanks,
--Steve

No, I have never heard of this. I've only ever used dynamic
techniques
to evaluate types. If I need to use functions in classes, I
include the
classes. If they're included in a separate SWF, I call them
there. If
it's a matter of suppressing warnings, I go back to step one.
If I need
local instance, I go dynamic.
In all honesty, I can't say I can see why this would ever be
necessary.
I mean, I completely understand excluding code out of a SWF
when you're
not using it or if it's supplied by a parent SWF. I use this
technique
every day to slim down code. But:
1. If I need to use ColorTween, I dynamically evaluate it at
runtime so
that I don't need to include it in my child SWF (this is
actually better
since I can do something else if the parent doesn't have it
for some
reason).
2. Use the generic type *. Whatever's in the parent, use it.
Depends on
how important the declaration is.
3. Dynamically determine the type at runtime so that if the
parent has
it, I can check to see if it is a ColorTransform and, if so,
use it.
The first step allows me to make my own instances, regardless
of which
SWF I need to use them in. The second step allows me to
reference
existing instances, regardless of which SWF they're in. The
third step
allows me to check if, either in step 1 or step 2, the type
is correct.
I don't think even think there's a fourth option in this
list, is there?
That being said, the only time I could ever see myself
needing a class
exclusion is if I simply said something to the effect of:
public var myVar:ColorTransform;
...in foo.fla. But that, to me, seems very dependent and kind
of
pointless. If you happen to run this SWF in a parent that
doesn't have
ColorTransform...well, that's the end of that, no?. I mean,
whatever is
depending on ColorTransform is basically out of luck and you
get a
run-time error, is that right?. Using dynamic evaluation, the
parent may
or may not have it and your code can continue to run and not
toss it's
cookies every time it needs to use a ColorTransform instance.
Also,
ColorTransform can be used from another SWF, and not be
hard-bound to a
parent instance (pre-existing condition). The only thing is,
you simply
don't specify that myVar has to be a ColorTransform, you
determine that
at runtime.
If I understand this correctly, you may as well include the
ColorTransorm class in foo.fla because if you're code is
depending on it
(using the above declaration), and you need to load the
parent to use
it...what's the difference from including it? If it's not
required, why
declare it or declare a strong type?
Maybe you can provide me with another example of how this is
intended to
work. Like I said, I understand the concept but I fail to see
the
practical use. I guess this may explain why I've never heard
of
this...the situation where this would be required has simply
never come up.
Patrick
swrb1977 wrote:
> Hi Patrick,
>
> AFAIK, it's just called class exclusion. I'm not
surprised if you're not
> familiar with this feature, there is no check box in the
IDE to click or
> anything and it's only mentioned once in the
documentation. This is how it
> works:
>
> Let's say you have an FLA called foo.fla and let's say
that foo.fla uses a
> class called "com.foo.ColorTween". You can tell Flash to
publish this FLA
> without the ColorTween class by creating an XML file
called "foo_exclude.xml"
> and placing it in the same directory as the FLA. The
contents of
> foo_exclude.xml looks like this:
>
> <excludeAssets>
> <asset name="com.foo.ColorTween" />
> </excludeAssets>
>
> When you publish the FLA, Flash will look for this XML
file. If it find it, it
> excludes the classes listed ("com.foo.ColorTween").
>
> Now, if you try to run this SWF, the player will freak
out when it tries to
> use this class. However, if you loaded this SWF into a
parent SWF that already
> contained that class, it would be able to run fine.
>
> This is described pretty well in this link
> (
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?
> context=LiveDocs_Parts&file=00000817.html). I think
Colin Moock also discusses
> the topic in Essential ActionScript 2.
>
> In terms of what I am trying to do specifically, I need
to export some library
> items as a swc, but not include the base classes. I
won't go too much further
> into why... I don't want to further confuse the issue.
>
> Hope this clarifies things a bit.
>

Similar Messages

  • AMFPHP hanging in browser but not Flash IDE?

    Wrote a service that sends a bytearray to my Flash app that works perfectly fine when I test it in the Flash IDE (CS5), and when I compile the app and run it in a browser directly from my computer.
    When I load it on to the server to run in my browser, the same service hangs. Can anyone think what may be causing this?
    I tested the service in the service browser and it worked fine there as well.
    I'm really hitting a wall on this, any help would be appreciated!

    What is ncDB? Is it a remote object?
    Remote object don't have a connect method. Istead you should set the endpoint, source and destination properties.
    If you handle your requests through AS3, you could do the following. I use this code in a singleton class.
    in the constructor:
    ws.RemoteObject = new RemoteObject();
    ws.destination = "amfphp";
    ws.source = "nameOfYourService";
    ws.endPoint = "linkToYourGateway.php";
    ws.addEventListener(FaultEvent.FAULT, this.faultHandler);
    In a method named 'call':
    public function call(endPoint:String = null, serviceMethod:String, resultFunction:Function = null, ...args):void
              if (endPoint != null)
                   ws.endPoint = endPoint;
                if (resultFunction == null)
                    resultFunction = defaultResult;
                if (ws.operations.hasOwnProperty(serviceMethod))
                    ws[serviceMethod].removeEventListener(ResultEvent.RESULT, resultFunction);
                    ws[serviceMethod].removeEventListener(ResultEvent.RESULT, defaultResult);
                ws[serviceMethod].addEventListener(ResultEvent.RESULT, resultFunction);
                ws[serviceMethod].arguments = args;
                ws[serviceMethod].send();
    Does this help?
    Dany

  • Air.update.ApplicationUpdaterUI in Flash IDE

    I can't for the life of me get this part of AIR to work for me in the Flash IDE. I hunted down the .as files and added them to my class paths, but when I tried to compile it couldn't find the swf files it needed.
    Can anyone help me out here?

    I apparently needed to add the "(CS5 Folder)\AIK2.5\frameworks\libs\air" to the Libraries part of my AS3 settings.

  • Flash IDE Components in Flex 3 Design Mode. Can they be visible there?

    Hi,
    Im exploring Flex to get a grasp on its concepts and am currently looking into building components in the Flash IDE. Though i guess its likely that when you're more familiar with Flex you build your components in Flex, like said Im exploring its concepts and like to know where and how the Flash IDE fits in its workflow.
    I made a simple Flex Component in the Flex IDE, which shows up fine when I run the Flex project. But it does not show in Flex Design Mode.
    I have exported the component from Flash as an SWC and added the SWC to the Flex library path. The symbol in the Flash IDE extends UIMovieClip. Now I read in 'Using Adobe FlexBuilder 3' (p.67) that the Flex Components panel only lists visible components, according to the documentation 'components that extend UIComponent'.
    Note that my question is about being visible on the stage in Design Mode, not in the component panel. As UIMovieClip doesnt inherit from UIComponent (and the UIComponent class doesnt seem to be available in the Flash IDE), is this also the cause that the Flash IDE component is not visible on the Flex stage in Design Mode?
    Can someone confirm, or deny this?
    Regards,
    Marcel

    Hi Latha,
    thanks for your feedback. Reading it back though, Im still not sure whether Flex components build in the Flash IDE (using the Flex Component Kit for Flash CS3) can be visible in Flex 3 Design Mode.Maybe you can be a bit more specific and save a lot of Flex beginners a lot of headaches.
    I understand that MXML components can be used in Design Mode. I also understand that if your component is AS you have to create a Library and link that to your project to make them visible in Design Mode. I also understand that Flash Builder 4 does "support rendering of UIMovieClip objects which are in library (swc) and added to the project build path"
    This actually doesnt answer my question really. Does this mean there is no way to render Flex components build in the Flash IDE (using the Flex Component Kit for Flash CS3)  in Flex 3 Design Mode?
    Regards,
    Marcel

  • Print in A4 size paper through AS3 using Flash CS5

    Hi all,
    Is any idea to print a job in A4 paper size by defult through AS3 using Flash CS5?

    Hi Shakeel,
    I am already having customised page format .
    It works fine when I choose Standard Device type EPLQ550
          But EPLQ550 is probably not supporting Arabic text.   It Gives ########
    Thats why I changed to Standard Device type ARSWIN
        Now Arabic text looks ok..... but Printer is not getting initialised after the first check. it skps.
    Pl suggest
    Thanks
    SK

  • Mx.transitions + movieClipLoader + Crashing Flash IDE

    Well I got this code straight from the adobe site and it is
    suppose to show how to use the mx.transition class with a movie
    clip loader. When I look at the code it seems right but the flash
    Ide keeps crashing but before that happens it prompts me that the
    code is causeing the player to be unresponsive like ther is a loop
    or something that won't end. I don't see any loop and would expect
    this code to have been edited on the adobe site if it were
    incorrect especially since it is fore mx 2004.
    and the link to the tutorial on this site.
    http://www.adobe.com/devnet/flash/articles/tweening_09.html

    Bad fla. Copied code and placed in new file work
    perfect.

  • Given a SWF file, how would I know on what Flash IDE has it been compiled?

    Hi guys,
    I have a series of modules developed  overtime and so some of them are AS1, AS2 and AS3. Some where compiled  using FlashMX, 8, CS3, etc.
    Sometimes it would be very beneficial for me if I could know with what version of the Flash IDE it  was compiled and targeting what platform.
    Is this  possible? Perhaps using some decompiler? Perhaps opening the SWF on a  text editor and looking for some string that tells this details?
    Thanks  for any comment or link you may post.
    regards,
    Miguel.

    a decompiler would let you see what version of actionscript was used and what flash player was targeted (among other things).

  • Flash IDE publishes SWF on every Flash Builder 4 save

    In FB4 I have created a 'New Flash Professional Project'.  The target FLA automatically publishes a SWF everytime I save a class in FB4, checking for errors, etc.  This is neat, but it's slowing my workflow, as I bounce between classes in FB4 & library assets in Flash CS5, I'm constantly waiting for the Flash IDE to finish publishing the SWF.
    My question is whether or not there's a way to disable the Flash IDE from automatically publishing on FB4 saves?

    iBrent helped to find in the FB4 Preferences > Workspace > uncheck Build automatically

  • Facebook connection using Flash IDE

    Hi,
    Ok so for many months now I have still been trying to find a decent tutorial on how to make a connection with Facebook using AS3 and the Flash IDE.
    I must of tried over 50 tuts by now and none seem to work. Obviously the update of the API causes issues however I've yet to find one tutorial which actually works and can bring in profile info like name, friends list and profile pics.
    Does anyone know of any tutorials showing this and how to achieve it?
    p.s please don't point me to the Adobe docs or Flash API wiki as their information and documentation is out dated. I have gone through all their examples with no success.
    I can only find examples for Flash Builder and maybe Flex, but I work with Flash IDE (5.5).
    What I want to do is to be able to connect to FB through Adobe AIR on my iPhone. I'm pretty skilled in as3.0 and adobe air for mobile and have done several games, I just don't know how this FB works and no tutorial seems to work anymore etc.
    Please, if you know how this works, can you please tell me?
    Much much appreciated

    I can help better if you can write the steps you followed and the places where you got stucks or errors that you see.
    Here are the general steps that you need to perform.
    1. Add reference to the facebook API SWC library in your project.
    2. call FacebookMobile.init(APP_ID,callback);
    3. In callback of init the signature is of this form private function callback(session:Object, fail:Object):void . If you get a non-null session it is of type FacebookSession and you need to check if you already have a valid acces token. to do this check if you have a valid (non-empty non-null accessToken) and expiryDate is still not elapsed. Otherwise you will need to call login method.
    4. If you do not have a valid accessToken you should call FacebookMobile.login. Which will ask the end user for credentials and athunticate the user. an example call I have used is as follows
                    var swv:StageWebView = new StageWebView();
                    app.stage.addEventListener(Event.RESIZE,function(e:Event):void{swv.viewPort = new Rectangle(0,0,app.stage.stageWidth,app.stage.stageHeight);});   
                    FacebookMobile.login(handleLogin,app.stage,['user_photos','friends_photos','user_photo_video_tags','friends_photo_video_tags'],swv);
    5. in handleLogin (Signature is same as that of init callback) if session still happens to be null the login attempt is failed and you can start inspecting the fail object for reason.
    6. If you get a valid session. You are all set to call the API and get the data that you want for eg. you can use something like following to get all information about the logged in user.
                var p:Object = new Object();
                p.limit = 0;
                FacebookMobile.api("/me",function(result:Object, fail:Object):void{
                    if(null == fail){
                        // process result for eg. result.name, result.username, result.gender, result.first_name
                    }else{
                },p);
    For the different api calls (The way I have used "/me" you can visit Graph API explorer)
    Please revert back for any issues that you find.
    I am working on a tutorial that allows one to use the Facebook Single Sign-On Feature in order to authenticate and authorize. Read more about it here. I will release the tutorial ASAP on my blog.

  • How to Play/Pause All for Adobe Air Application using AS3 in Flash CS4?

    I am new to Flash and I'm creating an educational application in AS3 in Flash CS4 for Adobe Air. I want to use buttons to play and pause all content (movieclips AND sound).
    I have created play and pause buttons that worked by switching the frame rate between 0 and 20, unfortunately I've realised that it's never really 0fps but rather 0.01fps and so it continues playing, albeit very very slowly. Also this doesn't affect the audio; I have set sound files to Stream which are synced to movieclips on their timelines, but even when the application is set to 0fps the audio continues.
    Since I have various levels with numerous movieclips each with synced audio, what i'd like is to be able to do is pause absolutely everything within each movieclip with one button and to be able to resume from the same place using another button. Is this possible? If not, is there a global function to pause/resume the entire application/program?
    Thanks in advance for your help!

    Its possible but you would need to tell each movieclip and audioclip to play/pause. You can create a for loop inside your mouse event function to find each movieclip and pause/play its timeline and a separate for loop for audio clips. Also instead of setting fame rate to 0 for pause just use a stop() command.

  • Adobe Flash IDE: Migration/Compatibility issues between Adobe Flash Professional CS3 and CS5

    Hi,
    Adobe Flash IDE: Adobe Flash CS3 Professional and Adobe Flash Professional CS5
    I am facing some  migration/compatibility issues between Adobe Flash CS3 Professional and Adobe  Flash Professional CS5:
    I am working on a project that has  been completely developed in CS3 earlier. When I am using CS5 (Flash Player 9 /  Flash Player 10) to compile the FLA files, it is creating some new issues like  some customized radio buttons are getting disappeared while viewing the SWF on a  web page etc.
    So, I would like to  know:
    1) Is there any  migration/compatibility issue between Adobe Flash CS3 Professional and Adobe  Flash Professional CS5?
    2) If yes: Is there any patch  available from Adobe for it?
    3) If no: What could be the causes  and the best possible solutions for it?
    Any help and support would be highly  appreciated. Many thanks in advance!
    Thanks & Regards
    Amit

    Apparently some people have issues, but I don't think it is across the board.  Here's a link to another recent posting that may or may not prove helpful to you...
    http://forums.adobe.com/thread/776615?tstart=60

  • 1067: Implicit coercion of a value of type Class to an unrelated type flash.display:MovieClip

    Hello, i've a class named LoadImages with the code:
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.display.Loader;
        public class LoadImages extends MovieClip
            private var _root:MovieClip=new MovieClip();
            public function LoadImages(numImages:Number, rt:MovieClip)
    and i've a second class named MainJogo that call's LoadImages:
    package
        import flash.events.*;
        import flash.display.Loader;
        import flash.display.MovieClip;
        import flash.display.Stage;
        import LoadImages;
        public class MainJogo
             #error
            private var imgMc:LoadImages=new LoadImages(2,this);
              #error
            public function MainJogo(url:String)
    if i just post the MainJogo class code in TimeLine there is no problems but if i run the app like this with 2 classes i keep getting the error
    1067: Implicit coercion of a value of type Class to an unrelated type flash.display:MovieClip.
    Can someone help me please?
    thanks

    MainJogo is not a Movieclip so "this" (in the scope of MainJogo) is not a MovieClip.
    if MainJogo did extend the movieclip class, you would probably still need to cast "this" as a MovieClip.
    you could use:
    package
        import flash.events.*;
        import flash.display.Loader;
        import flash.display.MovieClip;
        import flash.display.Stage;
        import LoadImages;
        public class MainJogo extends MovieClip
    private var imgMc:LoadImages=new LoadImages(2,MovieClip(this));
            public function MainJogo(url:String)

  • Customize class members and methods showed by IDE

    Is anyway to customize the output of the class members and methods show by IDE when you code a class?
    In detail:
    If you have a class A:
    A myClass = new A();
    and you tipe myClass.
    then the IDE show you a list of class members and methods in a Dialog Box....
    can you customize these????????
    I want to set another output for these....
    Thanks!

    That's not the meaning of the question.....
    When someone work with a Java IDE and are editing source, the IDE help you writing code showing you the members and methods of the object that you are working on, like these:
    a.------------------------
    | void setX(int x) |
    | void setY(int y) |
    These information is provided by the IDE. I think that it makes a special type of introspection on classes ..... but a really strong one, because it can access to private members and methods....
    I want to customize these behaviour....... and i want the IDE's show only the strings that i want....
    For exemple:
    a.------------------------
    | to establish X |
    | to establish Y |
    Thanks!

  • Change Flash IDE default player in OSX?

    Does anyone know if it's possible to change the flash player
    that Flash IDE uses? As far as I know, it uses the special
    debugging version of the player. For some reason this player runs
    much slower than the regular standalone player in OSX.
    So I'm trying to figure out if there's a configuration file I
    can edit or something to have it launch the standalone player when
    using the Flash IDE.
    There's a "players" folder Inside the main "Adobe Flash CS3"
    folder. I tried swapping out the player in there in the debug
    folder but it didn't seem to do anything.
    I know there's the nifty flash switcher app that does exactly
    what I need, but it's only available on the PC.
    Thanks for any help.
    -Ryan

    quote:
    Originally posted by:
    DeadCowboy
    I have still been having the same problem. I use Myspace for
    my band, and I continue to get the prompt that I do not have the
    current Flash installed and gives me the option to go to the page.
    I have uninstalled and then installed the brand new updated version
    and when it finishes the installation it opens Safari and sends me
    to the 'adobe about' page and again I get :
    >>>The page “Macromedia - Flash Player”
    has content of MIME type
    “application/x-shockwave-flash”, but you don’t
    have a plug-in installed for this MIME type. A plug-in should be
    available on this page:https://www.macromedia.com/go/getflashplayer
    Do you want to open the page?<<<.
    Your problem is completely different than what we're talking
    about in this thread.
    Your problem is discussed in the thread '[ADOBE] Resolving
    Mac Flash Player install problems 9/2007'. Check that out and you
    should be able to resolve it via permission repair.

  • Running multiple instances of Flash IDE CS(6)

    I have a build machine compiling my fla files by running Flash.exe from command line and supplying a JSFL file as a parameter. I want to run multiple instances of Flash IDE in order to enable concurrent builds on that machine otherwise there's only one thread running on a build machine which is a resource waste.
    So, is it possible to run multiple instances of Flash IDE? Maybe there's a kind of command line switch? I have Flash CS6, but there shouldn't be that many differences with CC, isn't it?

    I dont think you can run multiple instances of flash both in CS6 and CC.
    -Sujai

Maybe you are looking for

  • Can i use icloud on android for itune apps

    Can i use icloud on android phone to use snapsave and other purchased apps from itunes?

  • How can I save cfquery sql text, not the results

    Hi, I have the need to save a dynamically generated cfquery actual sql, not the results. I can see it in <cfdump var="#<qry_name>#"> but, how can I capture the actual sql and save it in a var for later use ? Thanks, Bob

  • Wildcard in filename

    I have a requirement. I have to send all the files in a particular directory to a reciever for which I am giving file name parameter as '*.pdf'  and a valid source directory from which to select the files. There are some 700 pdf files to transfer.  T

  • Not able to remove/repair reader X

    Installed reader X on winxp pro. Immediate problems displaying pdf's - get message that readerX has encountered a problem and must close. When attempting to repair/remove and re-download, get win intaller message - patch package could not be opened -

  • My Windows PC and iPod REALLY don't see each other

    the help page suggests as the last attempt that you restore your ipod - which you use the ipod updater software to do - but just like itunes and windows explorer, that application does not "see" my ipod attached - this just started happening out of n