External as2 userDrawingTablet into as3

created a tablet where the user could draw on the pad. i did it a while ago using actionscript 2. now i'm loading it externally into as3. when placed in as3 it seems to be confused as to where the tablet is and draws only on the bottom right and off the page. also have a text function that is not working properly either.
kind of a random application and random problem, but not sure where else to go with this...
was just wondering if anyone had done this and had a similar problem?
thanx

"submitter" is a movie clip on the main timeline. this code is inside submitter layed out with a mc named "blackboard". blackboard has a mc named "innerBlackboard" inside of it.
blackboard.clearChalk = function():Void {
    var cl = this._parent._parent.chalkLine;
    this.createEmptyMovieClip("chalkLayer", 0);
    this.chalkLayer.lineStyle(cl.thickness, cl.color, cl.alpha);
    this.drawings = [];
blackboard.clearText = function():Void {
    this.createEmptyMovieClip("textLayer", 10);
    this.textfields = [];
blackboard.clearAll = function():Void {
    this.clearChalk();
    this.clearText();
blackboard.enterDrawMode = function():Void {
    this.innerBlackboard.onPress = this.startDraw;
blackboard.startDraw = function():Void {
    var x:Number = Math.round(this._xmouse);
    var y:Number = Math.round(this._ymouse);
    var coordinates = [x + "," + y];
    this._parent.currentDrawing = coordinates;
    this._parent.drawings.push(coordinates);
    this._parent.chalkLayer.moveTo(x, y);
    this._parent.onMouseMove = this._parent.drawChalk;
    this.onRelease = function() {
        delete this._parent.onMouseMove;
blackboard.endDraw = function():Void {
    delete this.onMouseMove;
    delete this.innerBlackboard.onRelease;
blackboard.drawChalk = function():Void {
    if (this.hitTest(_root._xmouse, _root._ymouse)) {
        var x:Number = Math.round(this._xmouse);
        var y:Number = Math.round(this._ymouse);
        this.currentDrawing.push(x + "," + y);
        this.chalkLayer.lineTo(x, y);
    } else {
        this.endDraw();
    updateAfterEvent();
blackboard.enterTextMode = function():Void {
    this.innerBlackboard.onPress = this.startText;
blackboard.startText = function():Void {
    var d:Number = this._parent.textLayer.getNextHighestDepth();
    var x:Number = this._parent._xmouse;
    var y:Number = this._parent._ymouse;
    this._parent.textLayer.createTextField("t" + d, d, x, y, this._parent.width - x, this._parent.height - y);
    var tf:TextField = this._parent.textLayer["t" + d];
    this._parent.textfields.push(tf);
    tf.type = "input";
    tf.multiline = true;
    tf.wordWrap = true;
    tf.restrict = "^'<>";
    tf.setNewTextFormat(this._parent._parent._parent.chalkFormat);
    tf.embedFonts = true;
    tf.text = "Type message";
    Selection.setFocus(tf);
    Selection.setSelection(0, tf.text.length);
    tf.onKillFocus = function() {
        this.type = "dynamic";
        this.selectable = false;
blackboard.formatEntry = function():String {
    var tf:TextField;
    var d:Object;
    var entryXML    =  "<entry>";
    entryXML        +=         "<text>";
    for (var i:Number = 0; i < this.textfields.length; i++) {
        tf = this.textfields[i];
        entryXML    +=            "<field x='" + tf._x + "' y='" + tf._y + "' text='" + tf.text + "' />";
    entryXML        +=         "</text>";
    entryXML        +=         "<drawings>";
    for (i = 0; i < this.drawings.length; i++) {
        d = this.drawings[i];
        entryXML    +=            "<drawing coordinates='" + d.join("|") + "' />";
    entryXML        +=         "</drawings>";
    entryXML        += "</entry>";
    return escape(entryXML);
blackboard.clearAll();
blackboard.innerBlackboard.useHandCursor = false;
blackboard.width = blackboard._width;
blackboard.height = blackboard._height;
draw_bn.onRelease = function() {
    blackboard.enterDrawMode();
    text_bn.gotoAndStop("_Up");
    text_bn.enabled = true;
    this.gotoAndStop("_Down");
    this.enabled = false;
text_bn.onRelease = function() {
    blackboard.enterTextMode();
    draw_bn.gotoAndStop("_Up");
    draw_bn.enabled = true;
    this.gotoAndStop("_Down");
    this.enabled = false;
clear_bn.onRelease = function() {
    blackboard.clearAll();
submit_bn.onRelease = function() {
    var name:String = name_if.text;
    if (name == "" || name == "name (required)") return;
    var email:String = email_if.text;
    if (email == "" || email == "email (required)") return;
    entry = new LoadVars();
    entry.name = name;
    entry.email = email_if.text;
    entry.message = blackboard.formatEntry();
    returnEntry = new LoadVars();
    returnEntry.onLoad = traceReturn;
    entry.sendAndLoad("submitEntry.php", returnEntry);
function traceReturn() {
    if (this.result == "success") {
        blackboard.clearAll();
name_if.onSetFocus = email_if.onSetFocus = function() {
    this.text = "";
    delete this.onSetFocus;
name_if.restrict = email_if.restrict = "^'<>";

Similar Messages

  • Dummy Guide needed for converting AS2 code into AS3

    I have to convert my existing AS2 code into AS3, but I might as well be reading chinese. I never even began to learn AS3, it was still fairly new at the time and the class ended before we had an opportunity to even touch on it. My major was not web design, it was the print side of design. I took an additional class, after I graduated, to learn web design and our teacher told us, basically, that we were designers, not coders so we won't be getting much into actionscripting, beyond the basics. At the time I was relieved, but looking back, I really wish we would have gotten more into it. Bottom line, I need to learn now.
    Is there ANYONE that can help me out? I will list my code below, buy I am way beyond lost any help that can be provided, I would be so grateful!!!!
    On the main timeline I have the basic..
    stop(); -- I found the AS3 version, but I don't know what I'm looking at. I get "not_yet_set.stop()" and there are are 8 options I can choose from. I just want the timeline to stop until I tell it where to go next. And what is "not_yet_set"
    Then I have my buttons, which are, basically...
    on (release) {
    gotoAndStop("Home");
    Or "gotoAndPlay("Whatever");"
    I also have buttons for scrolling...
    on (press) {
    play();
    on (release) {
    stop();
    AND
    on (press) {
    _root.AboutMe_Controller.gotoAndPlay(…
    on (release) {
    _root.AboutMe_Controller.gotoAndStop(…
    For the on(release) command, this is what I found as the AS3 version: not_set_yet.dispatchEvent()

    because that's really as1 code, you have steeper learning curve than going from as2 to as3.
    first, remove all code from objects, assign instance names to your buttons and you can then start on as3:
    // so, if you name your home button, home_btn:
    home_btn.addEventListener(MouseEvent.CLICK,homeF);
    function homeF(e:MouseEvent):void{
    gotoAndStop("Home");
    p.s.  the not_yet_set stuff is there because you tried to use script assist or some other actionscript shortcut.

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • How do you load an AS2 swf into AS3?

    I think this is the way around my dilemma. How do you load and AS2 .swf into an AS3 file?
    thanks again!
    Steve

    check that code in your last thread:
    What is the  code to load a .swf file in AS3 on the same layer?

  • Load AS2 swf into AS3 swf

    here is the code i'm using:
    var url:String = "avm1.swf";
    var urlrequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loaderListener(loader.contentLoaderInfo);
    loader.load(urlrequest);
    function loaderListener(dispatched:IEventDispatcher){
    dispatched.addEventListener(Event.COMPLETE, assignSWF);
    function assignSWF(event:Event){
    addChild(loader.content);
    here is the error i get:
    It is illegal to move AVM1 content (AS1 or AS2) to a
    different part of the displayList when it has been loaded into AVM2
    (AS3) content.
    Is there a different way to do this?

    addChild(loader)

  • Problems with loading AS2 assets into AS3 container

    Hello,
    in a Project I use the AS3 Loader Class to load
    AS2-swf-files. The swf-files are placed into different subfolders,
    since they're using the same filenames and subfoldernames for
    config-files etc.
    The Problem is: Whatever swf-file I load first, it is
    working, but every swf-file after that fails. It seems to be
    loaded, but it's not working correctly.
    I'm using the attached code (easy as it seems) to unload the
    present content and then loading the new one. But also using a
    separated second loader to load the second file is not working.
    I made some kind of testcase (a loader with 2 content
    swf-files) for you, so you can understand what I'm talking about.
    Here you can download the
    testcase (28
    MB).
    It seems like there is a bug in the flash player 9 that
    prevents the AS2-content from being unloaded correctly from an AS3
    file. Can you confirm that there is such a bug? Or do you have an
    explanation for this behavior? Or even better: a solution or
    workaround?
    Thanks a lot!

    Thanks for your help, but as said ("But also using a
    separated second loader to load the second file is not working.")
    even when using a second loader (with a different name) the second
    file loaded will not work.
    I'm removing any EventListener from the first loader,
    unloading and then nulling it.
    But to me it seems, that the first content is not garbage
    collected and because of that, even when loaded with an other
    loader the first loaded swf-file interferes with the second.
    I came to this conclusion, because the first loaded swf-file
    is still working after trying to load the second file. And just
    more weird: the first loaded file is in the same state and also
    after closing the Flash-Player.
    You can see it for yourself: download the testcase. Start the
    testcase.swf. Load a contentfile. Skip a few pages. Quit the Flash
    Player. Start the testcase.swf again and load the same contentfile.
    You will see it's at the same position like before quiting the
    Player.
    And I can't help, but that seems like a bug to me...

  • Problem going to fullscreen after loading AS2 movie into AS3

    I've got a loader movie that is written in AS3, and
    fullscreen is enabled. I have a context-menu fullscreen trigger and
    a keypress fullscreen trigger built into the loader movie. When I
    load an AS3 movie or an AS1 movie through the loader movie, I can
    go to fullscreen without problems. When I load the AS2 movie, I
    cannot.
    Does anyone have an idea why this might be? I'm struggling.
    Thanks in advance.

    Thanks for your help, but as said ("But also using a
    separated second loader to load the second file is not working.")
    even when using a second loader (with a different name) the second
    file loaded will not work.
    I'm removing any EventListener from the first loader,
    unloading and then nulling it.
    But to me it seems, that the first content is not garbage
    collected and because of that, even when loaded with an other
    loader the first loaded swf-file interferes with the second.
    I came to this conclusion, because the first loaded swf-file
    is still working after trying to load the second file. And just
    more weird: the first loaded file is in the same state and also
    after closing the Flash-Player.
    You can see it for yourself: download the testcase. Start the
    testcase.swf. Load a contentfile. Skip a few pages. Quit the Flash
    Player. Start the testcase.swf again and load the same contentfile.
    You will see it's at the same position like before quiting the
    Player.
    And I can't help, but that seems like a bug to me...

  • FlashVar to as2 loaded into as3

    I am afraid I already know the answer to my question but I am
    hoping otherwise. Previously an AS2 movie loaded into an AS2 movie
    could get flashvar values through _level0 or _root. My problem is
    having an AS2 movie loaded into an AS3 movie and still letting the
    loaded AS2 have access to the flashvars. I can successfully get the
    flashvars into the AS3 movie so that isn't an issue. I searched
    around and couldn't find any posts that helped and if this has
    already been covered I would appreciate a point in the right
    direction.

    First off thank you for your replies, links and help.
    So my fears were correct, there is no easy solution. I was
    hoping that I could use loader variables to load flashvars to the
    loaded clip or something where I could still have the as2 continue
    to use _level0. The reason for keeping _level0 is the classic "I
    don't want to rewrite everything."
    Thanks again.

  • Convert onEnterFrame Event Handler  AS2 code into AS3

    My code of AS2 is given below. I do not know what event handler type is used and which event handler is used in AS3.
    onEnterFrame = function(){

    this.addEventListener(Event.ENTER_FRAME,onEf);
    // "this" references the movie itself, you can also use "stage" or the instance name of an object on the stage
    // look up addEventListener in the online help. This method takes two arguments, the event that you want to "listen" for and the name of the function to execute when the event occurs.
    // the function that will be called when the event occurs. It takes one argument that corresponds with the first argument of the addEventListener method.
    function onEf(event:Event):void {

  • Loading AS2 mc's into AS3 movies

    Hi. Using the following code to import AS2 mcs into AS3.
    var contenedor = new Loader();
    contenedor.load(new URLRequest("animal_catch2.swf"));
    addChild(contenedor);
    contenedor.x = 100
    contenedor.y=0
    BUT doesn't work too well. Games don't work but and the image is displaced. Would appreciate any help.
    Thanks in advance.

    Sorry, excuse me. The displacement was becuase I cut and pasted the and I've just seen x = 100.
    Anyway, the game still doesn't work.
    Also, even if mcs are imprted and have different sizes than the container, can't they fill the container anyway - with fullscreen or something.

  • Translating AS2 into AS3

    Hi, I am trying to create a scrollbar for a movie using a
    tutorial I found online (
    http://www.flashkit.com/tutorials/Interactivity/Scrollin-Jake_Gel-683/index.php).
    My problem is that I am new and am having issues translating the
    AS2 script into AS3. Is there anyone who could help me translate
    this:
    onClipEvent (load) {
    diff_y = bound_box._height-scroller._height;
    bounds = bound_box.getBounds(this);
    top = bounds.yMin+(scroller._height/2);
    bottom = bounds.yMax-(scroller._height/2);
    function updateScrollbar () {
    content._y =
    -(((scroller._y-top)/diff_y)*(content._height-bound_box._height));
    onClipEvent (mouseDown) {
    if (scroller.hitTest(_root._xmouse, _root._ymouse)) {
    startDrag ("scroller", false, scroller._x, top, scroller._x,
    bottom);
    scrolling = true;
    // here we stop the drag and set scrolling to false
    onClipEvent (mouseUp) {
    stopDrag ();
    scrolling = false;
    onClipEvent (enterFrame) {
    if (scrolling) {
    updateScrollbar();

    you have a 4 enterframe loops running continually when they
    only need to run after a menu item has been clicked and can stop
    after all menu items have reached their final positions.
    and you need to compute the final positions for each menu
    item after one of them is clicked.
    you might do better to check for an as3 tutorial for an
    accordian menu. it's a bit more involved than you're thinking.

  • Tweens don't work in multiple external AS2 SWFs loaded by AS3 SWF

    When I try to load a single external AS2 SWF in an AS3 parent
    SWF, scripted tweens using the mx.tween class work fine. However,
    when I load two or more external AS2 SWFs, the first will work, but
    in subsequent SWFs the tweens do not animate. Does anyone have a
    solution?
    Related post:
    http://www.actionscript.org/forums/showthread.php3?t=147637

    SymTsb,
    So what is the code to do that? To delete the TWEEN variable?
    easeTime = .5;
    var day_handlerX:Tween = new
    mx.transitions.Tween(daynightlabel_mc, "_x",
    mx.transitions.easing.Regular.easeOut, daynightlabel_mc._x,
    (left_point+daynightlabel_mc_leftDifference), easeTime, true);
    day_handlerX.onMotionFinished = function() {
    trace("day_handlerX="+day_handlerX);
    trace("day_handlerX onMotionFinished triggered");
    delete day_handlerX;
    trace("deleted day_handlerX="+day_handlerX);
    does not work. the TWEEN object is still there.
    Can ADOBE say something??
    AS3 is ...

  • Is loading a as2 swf into my as3 flash site the problem here?

    My question is listed on another board here, but I am too inexperienced to understand how to fix my issue:
    http://forums.adobe.com/message/5045059#5045059
    I went on flashkit.com and a member there immediately said that it "sounds like the problem is using the AS2 swf loaded into the AS3 swf."
    If it is... this mean I will have to convert everything in the AS2 .swf (including the XML retrieval script) to AS3. I may need some help with that if that is the problem.
    So will AS2 swfs cause XML communication and retrieval issues if loaded with a loader script into an AS3 file?
    Everything works (the buttons are clickable and when you click on a square in the "thumbnails" scroller it displays the correct photo title and captions), except I just cannot see the actual photos in my XML gallery. I am truly clueless as to why this happens and I've searched for days straight and tried many things...
    You'll find all the details of my problem in the above link.
    Thanks!

    Its really not worth the trouble to get as2 working with as3 if your goal is to make an xml driven gallery. There are literally thousands of free examples/tutorials how to achieve that feature with 50+ LOC. Like this one.

  • Loading an AS2 swf into a AS3 project?

    I have an AS2 swf that is merely an image gallery made with a few components. I tried loading this swf into an AS3 project I am working on and it seems to load in and play properly in my AS3 file. I'm not looking to communicate with the AS2 swf with AS3 code, I just want to display it and be able to use the component buttons in the AS2 file that play or stop the images from being played.  I was wondering if using this will cause any potential issues in my AS3 project. It seems to render and work fine on my machine. Thanks

    as2 swfs will play without problem when loaded into an as3 swf.

  • FAQ: How do I load an external SWF file into a parent SWF file?

    A ton of Flash users visit Adobe’s we site every month wondering  about how to load an external SWF file from within another SWF.
    Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
    How do I load more than one SWF?
    How do I load a SWF into a specific location in the display list?
    How do I resize the loaded SWF?
    How do I set its X and Y location?
    Here are some additional resources that elaborate on loading content and on working with the display list:
    Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
    Help > AS3 Developer’s Guide > Loading an external SWF file
    Help > AS3 Developer’s Guide > Loading display content dynamically
    Loading multiple external SWFs within a main SWF – CreativeCow.net forums
    Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
    Video tutorial: Preloading in ActionScript 3.0.  By Lee Brimelow. A slightly more complicated example, showing how to  make the parent SWF display information about the progress of loading  the external SWF.
    Tutorial: Loading and unloading SWFs - FlashAndMath.com
    This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
    SWF to SWF Communcation via ActionScript 3.0 (by kglad)

    quote:
    Originally posted by:
    NedWebs
    You now seem to want to get rid of the swf once it has loaded
    and played itself thru. To do that you would need to have something
    in the swf itself that triggers its removal in its last frame. The
    following might work...
    MovieClip(this.parent).removeChild(this);
    Unfortunately I couldn't get this to work. I placed it on the
    last frame of the SWF to be called - is that right?
    I am not sure I am doing it correctly...

Maybe you are looking for

  • I need to re-install acrobat pro 9 - from where can I download the software?

    My original purchase of Acrobat Pro 9 was downloaded online. I have not other copy and I need to reinstall to deal with corrupted files. Currently I am unable to download updates.

  • Inserting existing page from one document to another

    Hi, I have 2 documents. The first one is 4 pages and all pages are 8.5" x 11". The second document is 1 page and is 8.5" x 14". Is it possible to insert the 8.5" x 14" page from the second document into the first document, but make it the 4th page? (

  • Cable down

    I purchased a sun ultra 5 used that is supposed to have solaris 8 on it. When I try to boot from the disk it begins to boot and then I get a : SUNW,hme0: No response from ethernet network: Link down--cable problem? followed by a Starting IPv4 routing

  • Unspecified error (MS Visual Database Tools) in SSMSEE

    Hi all, I got some issue. Last few days ago, I downloaded Visual Studio 2010 Express Beta2 from Microsoft site and install it and tested the software. After that I found that my SQL Server Express 2005 is not working correctly. So, I remove/uninstall

  • Downloading of Acrobat X pro after changing to a new pc

    Hello! Pls. inform abt. how to download my Acrobat X pro into my new computer,- when using the serial no. in an ordinary downloading situation this is not accepted. The X pro is deleted in the old computer. All the best Arne