Using AlivePDF with AS3

Hi, I'm somewhat new to AS3 and programming. I'm trying to use the AlivePDF library to export text from a text editor created in AS3 into a PDF. Can anyone link me to documentation or a tutorial that can help teach me how to integrate it into a normal AS3 file? I have no idea how to use the library and the only documentation I've seen for it is how to use it in Flex/Air, which is not what I'm looking for.
Thanks!

Last year, I did a project that used AlivePDF. I found that there wasn't as much tutorial content on the Web as I would have liked. For folks that are new(er) to AS3 - it is lacking enough in Flash  tutorials to make it "kinda out of reach" without struggling. Even for  myself, I wished there were more simple, but extensive, examples to cull  from.
Like you, I kept getting search hits showing me a small handful of Flex apps that used it, but I was able to sift through a few things, including the website that provides the API for us. So this is most likely not going to get you what you want - it was a little bit of a slow start for me, and I just had to "grow" from the small examples I found on the main website, and look at the API documentation...and then put in the time to try my own simple tests.So, I can really only suggest that you start small, understand the basics of AlivePDF, and work from what you have success with.
You've probably been here, but most of what I learned came from the various pages of th main AlivePDF website:
http://alivepdf.bytearray.org/
The link to the API documentation:
http://alivepdf.bytearray.org/alivepdf-asdoc/
there's a Google Wiki, with other API notes:
http://code.google.com/p/alivepdf/wiki/APINotes

Similar Messages

  • How to use tile map with AS3?

    I have a file that contains a bunch of isometric tiles that I need to make a map with, much like a sprite sheet but not for making animations. So using AS3, how can I divide that file into the different tiles, knowing the coordinates of each of them. Or can it be done automatically in Flash itself, so I can access each tile from AS3?
    Furthermore I've been a programmer for a couple of decades but I am new to Flash. I know there are a ton of DisplayObjects like Bitmap, Sprite, Shape, MovieClip, Symbol etc. But which one would be better to use for that file? I need to access it from AS3 as described above, but I don't need it to react to mouse events, stretch or have children, just extract each tile and move it onto the stage with AS3.
    It seems to be down to a choice between Bitmap and Shape, since they're both lightweight, but I couldn't find out what the advantages and disadvantages of them are, as there was no comparison between those two on Google, though between a lot of the other objects. And Symbol seems like an idea too, since when I googled this, I found a lot of pages saying that you should convert a Bitmap to a Symbol, but I never found out why.
    Oh, and since I'm building an isometric map, all the tiles and all other graphics I'll be using, will be Bitmap and not Vector since I'm drawing the graphics in pixelart.

    create one tile symbol (movieclip or sprite so you can use actionscript to reference tile properties - like its x and y) and arrange them (using code or by hand) into your map.
    enable the cacheAsBitmap property of your map (that has some number of tile children).
    assign the mouseEnabled property of the map to false and its mouseChildren property to false.

  • What is wrong with as3

    this is not a question about 'how i do X'. is rather a 'discussion' (flame or whatever, but to defend or argue about aspects, not people) about 'what is wrong with as3' and what aspects whould be taken into consideration for updates. right now i am using as3, and since i paid for this license, i choose this tool over some alternatives and i am using it to do stuff for other people who pay me to do it, i think it can be helpful for all of us if some actions are started in the right direction. i have already posted about 'all people in adobe are dumbasses that do not know how to make a scripting tool and are messing up my work', but i was pissed at the time (i still am pissed) but i believe this is not the right aproach. instead, if this goes to the right people in adobe, we all may get something in the future, like better and easier todo apps and web presentations.
    pre: not only about the as3 specification, but COMPLY with the specification that you set. for example, some time ago there were problems with matrix transforms. this was corrected later with a patch. but this means it is not even doing what is is supposed to do
    1. scriptable masks and movement, sprites and child sprites: there is a sprite with a mask, the mask is a shape drawn via script, something like
    somemask=new shape();
    somemask.graphics.beginfill();
    (...etc)
    somesprite.mask=somemask;
    just like that. now add some child sprites to 'somesprite', and make 'somesprite' move, scale and rotate. there you will have something like a kaleidoscope, but not what you expected to do with your script. as the child sprites move in the parent mask, you will see that the child sprites appear or dissapear kind of randomly, and if the child sprites are textfields, it may be that the text is rendered outside the mask, or partially rendered outside the mask (as in only part of the text), rendered with the wrongf rotation or in the wrong place. some child sprites are clipped correctly, some dissapear totally when only a part should dissapear (clipped) etc.
    way around: have not tried it yet, but i have the impression that bitmaps have different criteria for clipping, so i am thinking of trying this: appli an empty filter (a filter with params so it does not have any effect on the sprite or in the textfield) so the sprite is rendered as bitmap before doing anything else with it. as i said, i have not done it yet, but it may be a way around this problem, to avoid all this inconsistency with clipping
    1-b. inconsistency between hierarchy and coordinates, specially masks: you apply a mask to a sprite, yet the sprite has a set of coordinates (so 'x' in the sprite means an x relative to its container), yet the mask applied to the very same sprite, as another reference as reference for coordinates (like the stage)
    2. painting via script: in any other languaje, in any other situation, something like:
    beginFill(params);
    (...stuff 1)
    endFill();
    beginFill(params);
    (...stuff 2)
    endFill();
    (...etc)
    means: render region of block 1, then render region of block 2 etc, and no matter what, it should be consistent, since there is noplace for ambiguity. if you read it, you may think what that means, even if you dont run it you may have an idea of the picture you want to draw, but not with as3. as3 somehow manages to screw something that simple, and mixes all the blocks, and somehow uses the boundaries of one block as boundaries for other block. is like all blocks are dumped into whatever, and then uses all lines defined into it as boundaries for a unique block. it changes all boundaries and generates inconsistency between what is shown and redraw regions of the resulting picture, like lines that go to the end of the screen and then dont go away in the next frames, even tough the beginfill endfill block should prevent it
    3. event flow: i dont know what was the policy behind as3 event flow design. it is in no way similar or an extension to previous event flow, neither with any event flow in any other plattform. i dont know how most people start with as3; in my case, i unpacked, installed and when i tried to do something with what i already knew i could not, so i started reading the as3 docs, and since is like 800 pages long, i just read the basics and the rest i would 'wing it'. in the part of the event flow, there was something about bubbling and stuff, it was not clear at all and when i tried to do what is was said in the documentation (like preventing events to 'bubble', as is called in the documentation), i could not see any effect but i could see it was a mess. flash is not the only thing out there to work with pictures or to work with mouse events, but is the only one that deals with things like 'target' and 'currentTarget'. my first experience on needing this was when i was dealing with my own event handlers (so the only thing that had control over mouse was the stage, and i would admin everything via script). there were events generated everywhere, the stage got events that were not genrated directly over the stage, but got there not with stage coordinates but the coordinates relative to the sprite that generated the event. so if i hover the mopuse over the stage, and the stage has some things on it how does it work? i get multiple event calls, like it was hovering multiple times over the stage in a single frame, but in each call with different coordinates? and what if i set all child sprites as mouseenabled=false or compare like 'if (event.target != event.currenttarget)', what if i move the mouse over a child, does it prevent the move mouse event at all? or does it filter only the event call with only stage coordinates? in my case, every time i move over another clip (with mouseenabled = true), the stage gets it as 'mouse up', even tough there was never a mouse release, what the hell? do even the people at adobe know how to handle events with their own tool when they require it? why does an event 'bubble' when i have not specifically tell it to do it? mi thought is that this event flow was very poorly conceived, and tough the intention may have been that there were different cases and it shopuld cover all cases, they actually introduced new problems that were not present in traditional ways to handle it, and it is neither the easier way to handle things, and this way, a very simple problem turns into a very ugly thing because it must handle things that were not neccesary to handle, or were implicit in other situations.
    4. legacy: since as3, all interaction is different, and if you want to do things in the new plattform, using the new features, what you already knew just goes to the garbage can. when a new tool arrives, it should be an extension to previous tools (which is a reason to update instead of just buying a new tool from a different vendor). if everything i had or knew just means nothing from now on, then i can not say 'i know flash script', and my previous knowledge gives me no advantage when aproaching the new version. as3 is a new aproach that requires doc reading and stuff, even if you knew something about previous as specifications or other oo languajes. if you decide to change things from now on, like the things mentioned in this post, instead of just throwing away everything the users alerady knew about the tool, do like in java releases, they mark some things as 'deprecated', they keep working as they should, give a warning, but also a message saying this feature is deprecated, we suggest you use this library instead.
    5. lack of previous functionality: if you 'update' something, it meand all previos functionality is still there (probably improved, but not with bugs if it was working fine), plus something else. now it seems backwards, there are some things that could be done in previous versions but not in this one, like 'duplicatemovieclip'
    6. inconsistency with scripting/programming paradigms: (ok, fancy work, but fits perfectly here): as3 proposed ways to handle things, but the people who designed it got 'too creative', and they did something that is not consistent neither with previous versions of as or with other languajes. the documentations is full of things like 'it looks like x languaje or languaje family, but instead of using XXX word, you must use YYY'. great, what is this? namespaces 'work like', but 'differently' for example from java, .net, .c. its got the idea that a namespace means a grouped functionality but there are rules about where should be placed the file (ok, java has this also, .net takes care of it automatically if all files are registered in the project), but what you got is a mess that 'if you know other languajes you got the general idea, but nonetheless, even if you knew this or previosu versions of as, you still have to read whatever we decided arbitrarily just to be different'. namespaces, event handling, vars definition which is not like previous scripting neither like fully typed languajes.. is just a mess.
    7. lack of scripting and graphics integration: unlike flash and adobe tools that just got on the graphics side leaving all the scripting integratuion apart, most tools from other vendors integrate very well interacton with what is on the screen. the script editor: very poor. autocompletion? a drop down list that does not heklp at all, appears in the wrong places, and when you need it to go, it does not go (so if i want to move away from the uncalled drop down list, i have to click somewhere else, making developement slowewr instead of helping, so the drop down list does not capture all events when i dont want to). in other ides you double click somewhere and it will go to the part of code relevant to that event or whatever. for example microsoft tools, ok i am antimicrosoft, and one of the reasons was that when windows 95 got to market proposing itself as the ONLY pc os you could use if you wanted to keep useing the apps you already had, it was a lousy product full of flaws but you had to keep using it because you had no choice. what is so different from what is happening with flash just now? yet the ide of c# is awesome, works very well and seems reliable.
    adobe people: not all user are designers that just make pretty pictures. if it is not intended for scripting then why is it there. and if there are corrections to be done, they should patch all versions, not only the last one. previous version users also paid for their versions.

    Well, there is no point in arguing.
    I personally believe AS3 does exactly what it promises to do within limits (read: reasonable limits) of ECMA type of language. And sometimes it doesn’t do what we expect it to for it cannot possibly emulate everyone’s thinking process. The task, I guess, is to learn to think in terms of AS3 – not to try to make AS3 think like us. No language covers all the grounds. And no, it is not Java - with no negative or positive connotation. It is what it is. Period. I just hope that AS5 will be more Java like.
    You are right about the fact that it is not necessary to know all the aspects of language in order to perform the majority of tasks. But it is paramount to have a clear idea about such fundamental concepts as display list model and events. For instance, depth swap has no meaning in terms of AS3 because display list object stacking is controlled automatically and there is no need for all these jumping through hoops one has to perform in order to control depth in AS2. There no more gaps in depths and one always know where to find things.
    Similarly, there is no point in having duplicateMovieClip method. More conventional OOP ways of object instantiation accomplishes just that and much more. Just because OOP object instantiation needs to be learned doesn’t mean past hacks have place in modern times. duplicateMovieClip is a horse carriage standing next to SUV. What one should choose to travel?
    Events are implemented to the tee in the context of ECMA specifications. I consider Events model as very solid, it works great (exactly as expected) and never failed me. True, it takes time to get used to it. But what doesn’t?
    By the way, speaking about events, contrary to believe in Adobe’s inconsideration to their following. Events are implemented with weakly reference set to false although it would be better to have it set to true. I think this is because there are smart and considerate people out there who knew how difficult it would be for programming novices to deal with lost listeners.
    I think AS3 is million times better than AS2. And one of the reasons it came out this way is that Adobe made a very brave and wise decision to break totally loose from AS2’s inherent crap. They have created a totally new and very solid language. If they had tried to make it backward compatible – it would be a huge screw up, similar to how our friends at Microsoft are prostituting VB and VBA – extremely irritating approach IMHO.
    Also, Flash legacy issues shouldn’t be overlooked. Flash did not start as a platform for programmers. Entire timeline concept in many ways is not compatible with the best OOP practices and advancements. I think for anyone who is used to writing classes the very fact of coding on timeline sounds awkward. It feels like a hack (and AS2 IS a pile of hacks) – the same things can be nicely packaged into classes and scale indefinitely. As such I wouldn’t expect Adobe to waste time on hacking timeline concept issues by making smarter editor. They have made a new one – FlexBuilder – instead. Serious programmers realize very soon that Flash IDE is not for developing industrial strength applications anyway. So, why bother with channeling great minds into polishing path to the dead end?
    I would like to state that all this is coming form a person who knew Flash when there was no AS at all. And I applaud every new generation of this wonderful tool.
    I believe Adobe does a great job making transition from timeline paradigm to total OOP venue as smooth as possible. And no, they don’t leave their devoted followers behind contrary to many claims. They are working on making developing Flash applications as easy as possible for people of all walks. Welcome Catalyst!
    Of course there is not enough information about AS3 capabilities and features. But, on the other hand, I don’t know any area of human kind activities that does.

  • Need to get rid of persistent images created with as3 - pls help

    I have used the following as3 code, courtesy of Jody Hall at theflashconnection.com .  It's a drag and drop that works great. Problem is the drag and drop images persist when I move on to other frames. How do I clear the images when finished so they don't appear in subsequent frames? Thank you in advance.
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    var sndExplode:explode_sound;
    var sndExplodeChannel:SoundChannel;
    var dragArray:Array = [host1, agent1, physical1, social1, host2, agent2, physical2, social2, host3, agent3, physical3, social3];
    var matchArray:Array = [targethost1, targetagent1, targetphysical1, targetsocial1, targethost2, targetagent2, targetphysical2, targetsocial2, targethost3, targetagent3, targetphysical3, targetsocial3];
    var currentClip:MovieClip;
    var startX:Number;
    var startY:Number;
    for(var i:int = 0; i < dragArray.length; i++) {
        dragArray[i].buttonMode = true;
        dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
        matchArray[i].alpha = 0.2;
    function item_onMouseDown(event:MouseEvent):void {
        currentClip = MovieClip(event.currentTarget);
        startX = currentClip.x;
        startY = currentClip.y;
        addChild(currentClip); //bring to the front
        currentClip.startDrag();
        stage.addEventListener(MouseEvent.MOUSE_UP, stage_onMouseUp);
    function stage_onMouseUp(event:MouseEvent):void {
        stage.removeEventListener(MouseEvent.MOUSE_UP, stage_onMouseUp);
        currentClip.stopDrag();
        var index:int = dragArray.indexOf(currentClip);
        var matchClip:MovieClip = MovieClip(matchArray[index]);
        if(matchClip.hitTestPoint(currentClip.x, currentClip.y, true)) {
            //a match was made! position the clip on the matching clip:
            currentClip.x = matchClip.x;
            currentClip.y = matchClip.y;
            //make it not draggable anymore:
            currentClip.removeEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
            currentClip.buttonMode = false;
            sndExplode=new explode_sound();
            sndExplodeChannel=sndExplode.play();
        } else {
            //match was not made, so send the clip back where it started:
            currentClip.x = startX;
            currentClip.y = startY;
    DRAG AND DROP (I JUST DID THE LAST FOUR FOR THIS EXAMPLE)
    MOVING ON TO NEXT FRAME, YOU STILL SEE THE RECTANGLES.

    Thank you SO muchNed Murphy
    I'm a newbie to AS3 and I was trying to figure it out for past 2 weeks that why did swapChildren or setChildIndex or addChild, all of these made my Target Movieclip remain/duplicate/persist on the stage even after the layer containing the Target Movieclip has blank keyframes. I surfed so many forums and tutorials for the answer but turns out it was my lack of knowledge of basic concepts. I remember checking out this specific forum as well past week but due to it being "Not Answered" I skipped it. This should be marked as a "Correct Answer", The Empty MovieClip did the trick!
    I needed this solution for a Drag and Drop game, so that the current item that is being dragged is above all other graphic layers. And when all items are dropped on their correct targets, there is gotoAndPlay to Success frame label.
    I created a movieclip on the top layer with the same dimensions as the stage and put it at x=0 y=0 position. Instance name: emptymc
    And deleted the emptymc from the timeline during the Success frame label.
    Here is some code I used,
    1. MovieClip.prototype.bringToFront = function():void {
       emptymc.addChild(this);
    2.  function startDragging(event:MouseEvent):void {
      event.currentTarget.startDrag();
      event.currentTarget.bringToFront();
    I didn't know how to put the addChild and refer to the currentTarget in the startDragging function itself, for example
    emptymc.addChild(event.currentTarget);
    - This one didn't work inside the startDragging function "emptymc.addChild(this); "
    Is there a correct way I could have done it properly?
    Thanks,
    Dipak.

  • How to access Image Metadata with AS3?

    An image, like a jpeg, has a bunch of metadata stored in it.
    The "IPTC Core" metadata usually includes the photographers name,
    address, title, description, etc.
    Is there any way to access this information using AS3 so
    that, say, captions for images in a flash gallery could be
    generated automatically?

    As far as I know this is not possible with AS3 directly, but
    if you are interested you could check out the as3corelib at
    http://code.google.com/p/as3corelib/
    They have some pretty nifty JPEG things going on there
    (although I do not know if this includes metadata - but I hope
    so).

  • Trouble loading an external swf file implemented with AS3

    I am using Adobe Flash CS3
    At first, I tried
    swf_mc.loadMovie("//swf file
    location");
    It gave me
    quote:
    Warning: 1060: Migration issue: The method loadMovie is no
    longer supported.
    USE: var l = new Loader(); addChild(l); l.load(new
    URLRequest("your url"));.
    Well, the given code isn't working at all.
    But since it is a migration error, I thought maybe I can just
    save it into Flash5 format with AS1. Then it worked with most
    external swf files. However, the one I am trying to load is a swf
    file with AS3, so my older version swf can't load it at all.
    Anyone has any ideas about how to load an external AS3 swf
    file?

    AS3 is a completely different beast than AS1 or 2. loadMovie
    was removed from the language.
    The answer to your question is two fold. First, Adobe was
    kind enough to give us the code when it finds a migration issue.
    var _ldr:Loader = new Loader();
    addChild( _ldr );
    _ldr.load( new URLRequest( "your url") );
    Handling progress has also changed. I have a ContentLoader
    package on my site that you're free to use that should familiarize
    you with the new way that things are done in AS3.
    http://sd-dezign.com/blog/?page_id=10

  • Working with AS3 External Classes

    Ok... trying to work with AS3 external classes. I have a movieClip that I want to also function as a button. Instance name is "_onDemand". This movieClip is on the stage of my Home.fla.  "_onDemand" movieClip properties   Class:HomePage  Base clase: flash.display.MovieClip
    I want the user to click this movieClip and take the user to an external URL within a new browser window or tab.
    Can anyone help me? Or at least point me to a really really good tutroial that does exactly this using external classes?
    Thanks so much,
    Mark
    My code:
    package com.cox4college.pages
    import com.gaiaframework.templates.AbstractPage;
    import com.gaiaframework.events.*;
    import com.gaiaframework.debug.*;
    import com.gaiaframework.api.*;
    import flash.display.*;
    import flash.events.*;
    import com.greensock.TweenMax;
    import flash.net.URLRequest;
    import flash.net.navigateToURL;
    public class HomePage extends AbstractPage
    public function HomePage()
    super();
    alpha = 0;
    //new Scaffold(this);
    override public function transitionIn():void
    super.transitionIn();
    TweenMax.to(this, 0.3, {alpha:1, onComplete:transitionInComplete});
    override public function transitionOut():void
    super.transitionOut();
    TweenMax.to(this, 0.3, {alpha:0, onComplete:transitionOutComplete});
    public class _onDemand extends Sprite
    // Link Navigation button handlers
    public var _onDemand:Sprite;
    // if you want a hand cursor
    _onDemand.buttonMode = true;
    _onDemand.useHandCursor = true;
    _onDemand.addEventListener(MouseEvent.CLICK, onDemandClickHandler);
    _onDemand.addEventListener(MouseEvent.ROLL_OVER, onDemandRollOverHandler);
    _onDemand.addEventListener(MouseEvent.ROLL_OUT, onDemandRollOutHandler);
    public function onDemandClickHandler(e:MouseEvent):void{
    navigateToURL(new URLRequest("http://ww2.cox.com/residential/santabarbara/tv/ondemand.cox"));
    public function onDemandRollOverHandler(event:MouseEvent):void{
    _onDemand.gotoAndStop("hover");
    public function onDemandRollOutHandler(event:MouseEvent):void{
    _onDemand.gotoAndStop("static");
    Getting the following errors:
    1120: Access of undefined property _onDemand.

    Ok. I admit it... I had some wonderful help to resolve this issue. You ever feel like you are on an island learning AS3 External Classes? I feel that way all the time... so far... I plan on not feeling that way soon. I hope this helps someone get off that island.
    package com.domainname.client {
        import flash.display.*;
        import flash.events.*;
        import flash.net.*;
        import flash.utils.*;   
        import caurina.transitions.Tweener;
        import caurina.transitions.properties.*;
        FilterShortcuts.init();   
        ColorShortcuts.init();      
        public class Main extends MovieClip {
            private var coverDelay:Number = 4;
            //#DF6D27
            public function Main():void {
                initMain();
            private function initMain():void {
                mc_form.visible = false;
                Tweener.addTween(mc_cover,{alpha:1,time:1,delay:coverDelay,onComplete:formIn});
                btn_onDemand.buttonMode = true;
                btn_listings.buttonMode = true;
                btn_ppv.buttonMode = true;
                btn_rhapsody.buttonMode = true;
                btn_onDemand.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_onDemand.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_onDemand.addEventListener(MouseEvent.CLICK,navClick);
                btn_listings.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_listings.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_listings.addEventListener(MouseEvent.CLICK,navClick);
                btn_ppv.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_ppv.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_ppv.addEventListener(MouseEvent.CLICK,navClick);
                btn_rhapsody.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_rhapsody.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_rhapsody.addEventListener(MouseEvent.CLICK,navClick);           
                function navOver(evt:MouseEvent):void {
                    Tweener.addTween(evt.target,{_color:0xffc614,time:.2});
                function navOut(evt:MouseEvent):void {
                    Tweener.addTween(evt.target,{_color:0xffffff,time:.2});
                function navClick(evt:MouseEvent):void {
                    var url;
                    switch (evt.target.name) {
                        case 'btn_onDemand':
                        url = new URLRequest("http://ww2.cox.com/residential/santabarbara/tv/ondemand.cox");
                        break;
                        case 'btn_listings':
                        url = new URLRequest("http://ww2.cox.com/myconnection/santabarbara/watch/entertainment/tv-listings.cox");
                        break;
                        case 'btn_ppv':
                        url = new URLRequest("http://ww2.cox.com/residential/santabarbara/tv/pay-per-view.cox");
                        break;
                        case 'btn_rhapsody':
                        url = new URLRequest("http://ww2.cox.com/myconnection/santabarbara/listen.cox");
                        break;                                                           
                    navigateToURL(url,"_blank");

  • Parenting and child control with AS3

    Hi,
    I'm new to AS3 and although I can see some good practice and functionality I'm constantly getting stucked and can't yet make things that I would do so easily with AS2 - I almost need to relearn it from scratch!. Still I would appreciate some help and guidance on this...
    I made a class that creates a "kind" of menu with data from a XML file and basically what it does when it is called is create a emptyMC (a container), add a childMC (a square) and add another child (a text label). When I create the container I'm trying to add a MouseEvent that can act on each the container instances but all I can get is a MouseEvent on object containing all the added MCs. The code follows.
    Can anyone enlight me with this issue or explain what am I doing wrong.
    I can't understand well the dynamic parenting with AS3 and the lack of using instance names and dot parenting doesn't help.
    Thanks in advance.
    Note to Adobe: Previous versions of Flash Help Files and AS reference were by far more helpful than in CS4!
    In the timeline:
    import assets.myDynMenu;
    var theMenu:myDynMenu = new myDynMenu("menu.xml");
    stage.addChild(theMenu)
    stop();
    In the class:
    package assets
         import flash.display.*;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import flash.net.*;
         public class myDynMenu extends Sprite {
              // INIT EXTERNAL DATA LOAD
              public function myDynMenu(theData) {
                   // LOADS THE MENU DATA FROM PREFORMATTED XML
                   var loader:URLLoader = new URLLoader();
                   var url:URLRequest = new URLRequest(theData);
                   loader.addEventListener(Event.COMPLETE, buildTheMenu);
                   loader.load(url);
              // XML MENU DATA LOAD CHECK - ON COMPLETE BUILD OBJECT AND CHILDREN
              public function buildTheMenu(event:Event):void {
                   var xml:XML = new XML(event.target.data);
                   for (var i=0; i<xml.menuData.menuItem.length(); i++) {
                        // ADDS A CONTAINER
                        var itemContainer:MovieClip = new MovieClip();
                        itemContainer.name = "menu" + i;
                        // THE NEXT LINE DOESN'T ACT AS I WISHED?!
                        // IN THE FUNCTION CALLED I NEED TO CONTROL THIS ITEM AND ITS CHILDREN
                        itemContainer.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
                        itemContainer.x = 100 * i;
                        itemContainer.y = 0;
                        itemContainer.mouseEnabled = true;
                        itemContainer.mouseChildren = false;
                        addChild(itemContainer);
                        // ADDS A CHILD TO CONTAINER (a square)
                        var itemBase:MovieClip = new MovieClip();
                        itemBase.graphics.beginFill(xml.menuData.mConfig.mainItemColor);
                        itemBase.graphics.drawRect(0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mConfig.mainIt emH);
                        itemBase.graphics.endFill();
                        itemBase.name = "base" + i;
                        itemBase.mouseEnabled = false;
                        itemBase.mouseChildren = false;
                        itemContainer.addChild(itemBase);
                        // ADDS ANOTHER CHILD TO CONTAINER (a text label)
                        var theLabel:TextField = new TextField();
                        theLabel.x = 5;
                        theLabel.y = 5;
                        theLabel.selectable = false;
                        theLabel.mouseEnabled = false;
                        theLabel.border = true;
                        theLabel.text = xml.menuData.menuItem[i].mName;
                        itemContainer.addChild(theLabel);
              // THIS IS THE MOUSE OVER THAT I NEED TO ACT ON EACH itemContainer (AND CHILDREN)
              private function onMouseOver(event:MouseEvent):void {
                   event.stopPropagation();
                   trace("You are over " + this.name );

    use:
    package assets
         import flash.display.*;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import flash.net.*;
         public class myDynMenu extends Sprite {
              // INIT EXTERNAL DATA LOAD
              public function myDynMenu(theData) {
                   // LOADS THE MENU DATA FROM PREFORMATTED XML
                   var loader:URLLoader = new URLLoader();
                   var url:URLRequest = new URLRequest(theData);
                   loader.addEventListener(Event.COMPLETE, buildTheMenu);
                   loader.load(url);
              // XML MENU DATA LOAD CHECK - ON COMPLETE BUILD OBJECT AND CHILDREN
              public function buildTheMenu(event:Event):void {
                   var xml:XML = new XML(event.target.data);
                   for (var i=0; i<xml.menuData.menuItem.length(); i++) {
                        // ADDS A CONTAINER
                        var itemContainer:MovieClip = new MovieClip();
                        itemContainer.name = "menu" + i;
                        // THE NEXT LINE DOESN'T ACT AS I WISHED?!
                        // IN THE FUNCTION CALLED I NEED TO CONTROL THIS ITEM AND ITS CHILDREN
                        itemContainer.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
                        itemContainer.x = 100 * i;
                        itemContainer.y = 0;
                        itemContainer.mouseEnabled = true;
                        itemContainer.mouseChildren = false;
                        addChild(itemContainer);
                        // ADDS A CHILD TO CONTAINER (a square)
                        var itemBase:MovieClip = new MovieClip();
                        itemBase.graphics.beginFill(xml.menuData.mConfig.mainItemColor);
                        itemBase.graphics.drawRect(0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mCon fig.mainItemH);
                        itemBase.graphics.endFill();
                        itemBase.name = "base" + i;
                        itemBase.mouseEnabled = false;
                        itemBase.mouseChildren = false;
                        itemContainer.addChild(itemBase);
                        // ADDS ANOTHER CHILD TO CONTAINER (a text label)
                        var theLabel:TextField = new TextField();
                        theLabel.x = 5;
                        theLabel.y = 5;
                        theLabel.selectable = false;
                        theLabel.mouseEnabled = false;
                        theLabel.border = true;
                        theLabel.text = xml.menuData.menuItem[i].mName;
                        itemContainer.addChild(theLabel);
              // THIS IS THE MOUSE OVER THAT I NEED TO ACT ON EACH itemContainer (AND CHILDREN)
              private function onMouseOver(event:MouseEvent):void {
                   event.stopPropagation();
                   trace("You are over " + event.currentTarget.name );

  • Loading external swf in array using wildcard in as3?

    Hi
    I can use the following code to load in a specific swf:
    var clips:Array = ["001/001.swf"];
    but how do I tell Flash to load whatever file is in the 001 folder without stipulating a specific filename?
    Thanks
    Shaun

    Not possible in Flash Player. Though this is possible in AS3 the API is only supported for AIR runtime and not for FP.
    The alternate way is to achieve this using PHP script which you can use in combination with AS3.

  • Reference external library movieclip in library with AS3

    Hello, i am able to load at runtime a library asset in flash
    cs3. i do this by setting up its linkage property and setting its
    base class. for eg
    Class: MyButton
    Base: flash.display.MovieClip
    then in my document class, say i had
    com.kofi.InitializeTemplate, my class looks like this
    package com.kofi
    import flash.display.MovieClip;
    import MyButton;
    public class InitializeTemplate extends MovieClip
    var testButton:MyButton;
    public function InitializeTemplate():void
    trace("the button class has been called");
    testButton = new MyButton();
    addChild(testButton);
    however, once i bring in an external library asset(which i
    have already exported and set it base class etc), i am unable to
    call this shared library asset with as3. anyone know what i am
    talking about?

    Hi Sigiswald,
    well it seems SAP also considers that a bug, if you go to the Service marketplace -> Support Packages and Patches -> SAP NetWeaver -> SAP NETWEAVER -> SAP NETWEAVER 2004S -> Entry by Component -> Development Infrastructure, there is a SAP_BUILDT SP09 Patch 1 referring to note 993799 which says:
    "Jar files, especially from development components with type "External Library" are not assembled into the WDA archive for Web Dynpro development components."
    Are you using the original SP09 version or this patch?
    Regards,
    Marc

  • Is it possible to make a timer with AS3 which is accurate upto one millisecond.

    I am new to AS3. I have somehow developed a auditory and visual reaction timer by taking script from here and there. I know its not accurate and I also know that I will write it correctly when I have learned the script thoroughly,
    But I was checking the net about the timer class and various posts on it and  I am vexed with a question "if its possible to make an accurate timer with AS3?" can somebody please tell me for sure. and I will be grateful if I know how to make it correctly. I can post the code which I have written ( assembled ).

    the answer is, maybe. but for, for most coders, the answer is, no.
    getTimer() is accurate to within 1 ms.  but that allows you to determine time/elapsed time and does not call or execute code on a regular timed schedule. it can be used with the timer class or enterframe events to do some things accurately.
    however, the timer class is not accurate in the way beginning coders think.  it will, on average, allow calling a function at close to the designated interval if there are no performance issues with your swf.  it does not allow each function call to occur at a regular interval.

  • How to execute one .exe file with as3 in air ?

    Hi
    How to execute one .exe file with as3 in air?
    I want do this work without fscommand .
    plize help me .

    itsdhanasaraa wrote:
    But as this a web application ... By using Runtime i'm getting some probs ..
    Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
    Ain't gonna happen.
    its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
    1) it's not "taking more time to execute", whatever that's supposed to mean.
    2) there's no other way to execute something. Not that you should every use even that way anyway
    3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place.

  • What's wrong with AS3?

    Hi.
    Is it me, or is AS 3 completely different from AS 2? I mean i
    haven't been able to write a single line of code that would work in
    AS 3. I wasn't a master in AS 2 and now i can't create anything in
    AS 3.
    Is there a setting or something for AS 3 to work like AS 2 or
    do i have to learn it all over again, starting from ground zero?
    Can someone help me with some hints?
    Thank you. Any help is much appreciated.

    The best book IMO is "Essential Actionscript 3.0" by Colin
    Moock. It takes you back to the rudimentary basics and guides you
    through them to the more advanced stuff. For me, going from AS2 to
    AS3 was a big leap and Colin's approach of starting back at square
    1 is very helpful.
    Some online resources that are good are:
    1. This forum.
    2. The Adobe Developer Center for Flash -
    http://www.adobe.com/devnet/flash/
    3.
    http://www.gotoandlearn.com/
    - great Flash how-to VIDEOS
    4.
    http://www.kirupa.com/developer/flash/index.htm
    Some good articles on OOP in AS3:
    http://www.awestyproductions.com/tutorials/flash-tutorials/learning-how-to-oop-in-flash/
    http://www.adobe.com/devnet/flash/quickstart/creating_class_as3/
    http://www.communitymx.com/content/article.cfm?page=1&cid=197DE
    http://www.actionscript.org/resources/articles/698/1/Make-your-own-reusable-classes-using- Flash-and-AS3/Page1.html
    http://www.test1labs.com/?p=13

  • Arabic project in CS3 with AS3

    dear friends,
    i need to create an arabic project in flash CS3 with AS3 coading. i am using normal version of flash. i need your advice,
    1) do i need middle east version to type and get arabic text?
    2) if i can use the same software and show the arabic text or enter the arabic text in run time what should i do? pls advice me.
    tell me how can i manage with the existing software and do the arabic project. i typed arabic text in this CS3, al the text is coming as broken, output also broken.  pls help me..
    Thanks in Advance,
    Syed Abdul Rahim

    Hi Syed,
    You need to install Adobe Illustrator ME (Middle East Version), otherwise the arabic text will appear as detached letters.
    Adding arabic fonts will not do the trick by itself.
    As far as i know, there is no other way, and i am not sure if there is Flash ME.
    And in case you cannot get this version you could always try typing it in MS Word and tracing it in Illustrator or Flash.
    Regards,
    Marc

  • How to Load an external swf using loadmovie in AS3

    I need to create a button with script, on rollover load an external swf into movieclip in AS3.  This was able to create this in AS2, but I need to create this in AS3

    Thanks again Ned.
    Kenneth Russell
    graphic artist, Sr.
    Lockheed Martin - MS2
    2323 Eastern Blvd., Baltimore, MD 21220
    Phone 410.682.0554    Fax 410.682.0543
    From: Ned Murphy <[email protected]>
    Reply-To: [email protected]
    Date: Thu, 23 Jul 2009 19:08:25 -0600
    To: kenneth russell <[email protected]>
    Subject: How to Load an external swf using loadmovie in AS3
    In AS3 you use the Loader class to load external swf's and image files.  You
    should be able to find examples both in the Flash help files and these forums
    if you search.  If you aren't aware of how to code buttons in AS3, that can be
    found as well.  In AS3, just about any kind of interction involves the use of
    event listeners in combination event handler functions... in the case of a
    button rollover an example would be...
    btnName.addEventListener(MouseEvent.ROLL_OVER, overHandler);
    function overHandler(evt:MouseEvent):void {
         // your loading code or whatever
    >

Maybe you are looking for