HTML5 Canvas: addChild and position

Hey Guys
I have an item on the stage called 'square1', I have added a symbol from the library and given it the name 'circle1'.
I wish to position circle1 at the exact location of square1, my question is - how would I go about doing that?
Thanks

Knowing JavaScript is going to be essential for you to use Canvas. If you really don't want to get your hands into the code you should do your best with the timeline.
If you're ready to take the canvas plunge then JavaScript has to become a tool for you. The second page of what I linked would show you that for almost every bit of ActionScript you might be used to, there's a translation over to JavaScript that's necessary. So every time you go to do something you're going to be right back here.
The best option just might be for you to take a look at EaselJS. There's lots of very simple demos that can get you started with HTML5/Canvas and will give you answers you want in Flash. Take a look:
CreateJS | A suite of Javascript libraries and tools designed for working with HTML5

Similar Messages

  • Flash Proffession CC 2014 HTML5 Canvas drag and drop not working

    Hi,
    I am making drag and drop in Flash professional CC 2014 using canvas and it is working fine on desktop but same when I am testing in Android tablet it is not working.  Can any one please advise how to make drag and drop application from Flash CC 2014 which will work on both web/pc desktop HTML5 canvas and all android devices.
    Thanks

    I just discovered something.  What I meant above is that I cannot drag and drop files from the "Media Browser" panel.  Surely that should be possible.  After all, that is how you browse your music files.  If I first double click a file in the browser so that it opens in the "Files" panel, I can then drag and drop files from there.  That is ridiculously tedious however because that opens the wave file and closes the "CD Layout" panel.  I then have to reopen the "CD Layout" panel before I can drag and drop a file.  I'm pretty sure you should be able to simply drag and drop from the Media Browser.  Any comments from Adobe?

  • MovieClip, addChild and Position

    Hi!! I'm having a problem with a MovieClip...
    I have 2 different MovieClips... that I'm putting into another MC (mc3)..... the new MC's position is x=0 y=0.... I assume this is default....
    what I'm trying to do is change the position of my MC.... but I want the other 2 movies inside (mc and mc2) to be on x=0 and y=0 inside the new movieclip....
    I hope it's not too confusing.... I'm doing this because I'm trying to save the movie as a jpg.... and the only way i can see the file complete is when I set the size of all the stage (1024 x 768).... I only want to save the mc3....
    here's my code.... hope you can help me
    var mc3:MovieClip=new MovieClip();
    addChild(mc3)
    mc3.addChild(mc)
    mc3.addChild(mc2)
    mc3.x=292;
    mc3.y=126;
    //this is what's happening when i save the file

    Thanks but no, that's not doing anything.... it's moving the contents....
    what I'm doing is a game of drag and drop, where children can choose an undefined number of houses and buildings, and arrange them over a city... that's done.... the background and houses are inside mc and the buidings are inside mc2.... I'm working  like that 'cause I must be able to erase everything on each step of the way... erase houses.... then erase buildings..... finally, when everything is over, I have to be able to save the map with the houses and buildings as a jpg file... and also I have to be able to print the map..... that's why I put both mcs inside a new one (mc3) to deal with only one movieclip............  the print part is going fine.... but I can't make the jpg to be just the map.... in order to see the map complete I have to save the file with a size of 1024 x 768... and the idea is to save a jpg with just the map......
    so I was wondering if there is a way to change the position of the movieclips inside my new movieclip.... or any other way I can fix this....
    thanks!!!

  • Installed latest version of Flash CC and did not get HTML5 Canvas

    Hello,
    This weekend I installed Flash Professional CC on a new Mac running Mavericks. It is a new OS and the first time installing Flash CC on it. After the isntallation I ran the program and saw that I do not have the HTML5 Canvas options that came with the November release. I went to Flash --> Help --> Updates and ran the update tool. It told me that I have the latest version.
    Does anyone have any suggestions?
    Matthew

    What is your Flash Pro version? (13.1.0.226 was the last released version) You should see an option  for 'HTML5 Canvas' document on the Start page and New document dialog.

  • A puzzle I made in Adobe Flash on an html5 canvas only works in Firefox, and not in other browsers. What should I do?

    I made a puzzle on a html5 canvas in Flash CC, and followed the exact steps of an online tutorial. The final product works in Firefox, but not in Chrome or Internet Explorer. What am I doing wrong?

    Call up the Javascript Console in Chrome and see if it's showing error messages.
    Also, you might try uploading it to a web server and viewing it from there (or turning Apache on locally). It may be a cross site security issue.

  • Flash Builder 4 and the HTML5 canvas tag

    I see that in CS5 you will be able to import Flash animations into HTML5 Canvas code
    http://www.readwriteweb.com/archives/flash_now_importable_to_hmtl_canvas.php
    Is this a planned feature for Flash Builder?

    Thanks Matt for the error message.  Found a bug report for the issue with adobe.  Turns out Flash Builder 4 will not support Flex 2 SDK
    [https://bugs.adobe.com/jira/browse/FB-15688]
    Which means that we can't compile within the IDE, but can compile outside using the command line.  This will be adding yet another layer to the development process
    Matt, any news on when Flex 3 will be supported in the SDK?  With the release of Flex 4 i'd imagine it's coming up.

  • How do I convert an HTML5 Canvas arc() to JavaFX Canvas arc()?

    I wish to convert a statement from JavaScript used in an HTML5 Canvas such as:
    ctx.arc(x, y, (rad+5)*factor, 0, Math.PI*2, true);
    to the equivalent statement in JavaFX.
    What would it look like?
    For reference, in HTML5 Canvas the arc() method is defined as:
    x
    The x-coordinate of the center of the circle
    Play it »
    y
    The y-coordinate of the center of the circle
    Play it »
    r
    The radius of the circle
    Play it »
    sAngle
    The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
    Play it »
    eAngle
    The ending angle, in radians
    Play it »
    counterclockwise
    Optional. Specifies whether the drawing should be counterclockwise or clockwise. False=clockwise, true=counter-clockwise
    but in JavaFX it is defined as:
    public void arc(double centerX, double centerY, double radiusX, double radiusY, double startAngle, double length)
    Adds path elements to the current path to make an arc that uses Euclidean degrees. This Euclidean orientation sweeps from East to North, then West, then South, then back to East.
    Parameters:
    centerX - the center x position of the arc.
    centerY - the center y position of the arc.
    radiusX - the x radius of the arc.
    radiusY - the y radius of the arc.
    startAngle - the starting angle of the arc in the range 0-360.0
    length - the length of the baseline of the arc.
    Could someone please show me what the JavaFX arc() statement would look like and explain how to convert between these two?
    Thanks.

    No conversion possible. Are you on a responsive project perhaps? Then
    output is only HTML, mobile devices do not support Flash.

  • HTML5 Canvas (in Flash CC) Button Functionality Faulty - Over, Down states do not work

    I have searched and searched and I can't find a solution.
    In Flash CC, creating in an Actionscript 3.0 canvas, buttons work as expected. Up, Over, Down and Hit states produce desired results.
    I am creating an HTML5 animated webpage and none of the buttons work as expected. Here are the flaws:
    1 - There is no hand when a button is scrolled over. This is an issue because there are multiple objects on stage, only half of which are buttons. The user needs to be able to know which are clickable.
    2 - When I have an image on the Up state, all is well. But when I add an image on the Over state, it causes a loop. Up and over just loop in the preview and after I publish regardless of the cursor position and regardless of the browser type (FF, Chrome, IE).
    I have searched the web. A lot of people have this problem but no answers have surfaced. I don't particularly want to spend another 100 hours recreating in Edge Animate--which I am not as familiar with. Is there some code that might stop all the madness?

    You can program using java script in flash.
    use the code
    exportRoot.stop();
    inside the button frame
    if not working and all becomes gray as described above then target your button from the main timeline like
    exportRoot.someClip.subClip.stop();
    But remember to change .someClip & .subClip with their correct names.

  • Is there Touch Gestures events on HTML5 Canvas?

    Hi, I'm really new in html5 canvas and I've started with an adobe tutorial about a jigsaw using Flash CC http://www.adobe.com/inspire/2014/03/flash-pro-jigsaw.html
    It works great on desktop but not on touch devices. The drag gesture doesn't works 
    this is the demo: http://www.adobe.com/inspire-apps/flash-pro-jigsaw-0314/fig1/Puzzle.html
    Is there something like gestures events on flash CC?
    Anybody can tell me where start to read about?
    Thanks
    Sebastian

    If you want to stay on the web and out of AIR you should take a look at EaselJS, a sibling of CreateJS. Specifically the MouseEvents it supports on Canvas:
    http://www.createjs.com/Docs/EaselJS/classes/MouseEvent.html
    There's only 2 events but gestures are just events in a specific order. For example a swipe is just paying attention to the mousedown, mousemove, mouseup and the amount of time it occured over. During the mousemove event you should watch the amount of pixels occuring. If the user swipes left (negative X) or right (positive X) quickly (under a second) then you yourself know the user probably intended a swipe.
    You can easily code other gestures as well in this manner. Give EaselJS a look. It's designed to make HTML5 Canvas easy to use.

  • Safari doesn't load pages containing html5 canvas on iMac

    Suddenly Safari either is very slow to load or doesn't load some pages at all.
    I have tracked it down to be pages containing html5 canvas element.
    This happens only on iMac and Macbook Air. It doesn't happen on iPad nor on Safari on a Pc. It will happen on the Mac computer both when the pages are out on the internet and when the pages ar locally stored. It's driving me absolutely mad!
    I've tried emptying cache both through Safari menu and by removing Safari's Cache.db, I've reset Safari preferences, restarted, and changed DNS to Open DNS (though it seems strange it should be an issue since the problem also occurs when I run the site on localhost).
    If I open the page directly entering the url in the adressbar it works fine, it is when I try to access it from a link on another page on the site it doesn't load. If I press reload it will load fine. The link from other pages can be either an html <a href="url"> tag or javascript window.location or window.location.href neither works. The weird thing is it worked fine until just yesterday. And it works fine on every other machine except the Macintoshes. WHY

    Hi Carolyn,
    Thanks for the quick reply. I've tried everything you wrote now, however the problem remains.
    One thing I've noted though is that the page actually loads but it takes very very long time, and sometimes when the pages have been loaded the images doesn't look quite right until I hit the reload button.
    I've been thinking about another thing, there are a lot of effects like round corner, shape and text shadow, can it be these that cause the problem? I still think it is very strange though that it all of a sudden stopped working and that running it on PC or iPad everything is just fine.
    Another thing to add is that the computer is very new just got it like 2-3 weeks ago, and haven't hardly added anything except got Xcode, macVim, firefox and Filezilla.
    Also just before the problem appeared I ran a page with javascript that had me caught in an endless loop of alerts. Got that fixed, but ever since that some pages won't load correclty...
    Is there possibly anything else I can do to fix this?

  • Is there any way to use video with the new Flash CC HTML5 Canvas?

    I am a long time Flash user trying to determine if this new version of the program is something to add to the workflow again (after the last several years of not being able to use it) and the tutorials I have seen are not well written. Is there a way to use a video file within the animation, like with the AS2 and AS3 versions of Flash where I could insert a video clip into a symbol and animate the symbol while the video played.
    What I need to know is what format of video file I should use and how to add it into the timeline since Flash does not seem to be allowing for any type of import for this.
    Any Thoughts?
    Thanks,
    Brett

    Ok, so there are limitations, are they written down somewhere? I have been looking for a list of do and do not functions and the ways to work around them. Are they in the documentation somewhere I haven't discovered?
    Right now all I am looking to do is create Classic Tweens that animate movement and opacity so I can create a presentation with video that includes these elements. Is that level of functionality available in the HTML5 Canvas, or is that still on the drawing board?
    Is there a specific name for what I am looking to do that would aid my search? HTML5 video is not enough since the answer has not been forthcoming in Google or on Adobe or Stack Overflow. I am starting to think that nobody has thought of this yet, or if they have they decided that it is not currently possible and skipped the part where the rest of us find out.
    Any thoughts on making the connection to either doing this or finding out that it is just not possible yet would be very helpful.

  • HTML5 Canvas issue with iOS Safari

    I am trying to build a painting application in HTML5.
    I have an HTML5 Canvas in a div. This div is masked with an SVG file using -webkit-mask.
    On iOS Safari and in iBooks Fixed Layout: When you zoom the page by gesture, the mask suddenly stops working revealing the entire canvas and the contents of the div.
    1. There is no problem if the contents of the div is an image. Problem is only with Canvas inside.
    2. The problem seemed to happen when the zoom crosses a mark - possibly 50%. I.e, if you have already zoomed over 50% and refresh the page, there is no problem until you zoom out below 50% and vice-versa.
    Any help would be greatly appreciated.

    Hello Corey,
    I have been trying to work on this issue, but I haven't made much progress
    Breaking up the project into several small chunks seemed to help for the iPad, but it's not ideal.
    I'm seriously struggling with Android tablets though.  Android doesn't support flash anymore, as HTML5 is the "future". Google Chrome on Android tablets has problems with synchronizing animations and sounds cutting out (works fine on a desktop or notebook).  FireFox on Android didn't have the sync or sound issues, but it crashes at random times. I think the root cause behind all this is HTML5 and the browser.  I couldn't figure out the difference between chrome on desktops and notebooks -vs- tablets.  I went to html5test.com and compared the two browsers, and there is definitely a difference between the two browsers.
    When you look at authoring alternatives to Captivate, it seems like their customers are having similar issues.
    I'm still looking for a workaround.  I'll let you know if I find anything

  • Illustrator to HTML5 Canvas Plug-In

    I hope it's not considered too much self-promotion, since it's a free plug-in for both Mac and PC. But, today, I released a plug-in that takes your Illustrator artwork and converts it to HTML5 canvas commands. It also enables some simple animation directly from Illustrator. This plug-in focuses more on the canvas element, where Adobe's HTML5 Pack focuses more on SVG. They make a great pair!
    http://blogs.msdn.com/b/mswanson/archive/2010/10/12/adobe-illustrator-to-html5-canvas-plug -in-released.aspx

    I believe you can post information about plug ins and and even announce update to even commercial plug ins but you cannot promote the sale of it with postings that are clearcut sales pitches or indicating that the software is approved by or that you are a part of Adobe.
    You can not use the forum to promote products that have no direct relationship to Illustrator or some form of integration.
    It is mentioned often that a well use plug in for this entity or tht entity is now available ot=r it will work to do what you want.
    So it seems you are fine. Now if you were selling watches, especially ones designed using Corel or Freehand that might not be allowed.

  • JS-Linter,a static javascript analysis extension for HTML5 Canvas documents in Flash Pro CC

    JSLinter is a  extension for Flash Pro CC for static code analysis of timeline javascript in ’HTML5 Canvas’ docs.It helps to detect errors and potential problems in your timeline javascript code .
    You can download the extension form my blog here
    http://hemanthkumarr.wordpress.com/2013/12/05/js-lintera-static-javascript-analysis-extens ion-for-html5-canvas-documents-in-flash-pro-cc/

    Checked just now .It is working for me and i can download the extension.
    Can you just verify again and let me know?
    -Hemanth

  • HTML5 Canvas: Removing EventListeners

    Hey guys
    I'm working on a project using the HTML5 canvas - quite simply, I have a 5x5 grid of squares that disappear when you click on them.
    Adding the listeners is fairly straightforward, I'm using the following code:
    var begin = addEventListeners.bind(this);
    var finish = removeEventListeners.bind(this);
    function addEventListeners()
      for (var i = 1; i < 26; i++)
      this["square"+i].addEventListener('click', squareClicked.bind(this["square"+i]));
    begin();
    This works just fine, there's a function called squareClicked that hides the square.
    The problem comes when I try to remove a listener, I've tried this:
    function removeEventListeners()
      for (var i = 1; i < 26; i++)
      this["square"+i].removeEventListener("click", squareClicked.bind(this["square"+i]));
    But no luck at all, I'm stumped, how would I go about doing this?
    Thanks

    Yes, I already pointed out in the first post that you can change the compression at the individual asset level and that there doesn't seem to be any way to change it in the publish dialog.
    Seems a bit absurd that the ability to change the default compression got left out of HTML5 mode. This has been core Flash functionality since pretty much forever.

Maybe you are looking for

  • How can I find old recipes from eprint Entree?

    I rwecll getting a recipe from eprints sometime in July of this year. I cannot find the recipe but wondered is there an archive section for eprint's Entree app?

  • Populate OIM Lookup With Database Values

    I am trying to figure out a way to populate a lookup in OIM with values from an Oracle database. For example, I have a table containing a list of departments with their department ID. I would like to pull these values into a lookup. The AD connector'

  • Is there a future for Firefox on the Mac Power PC platform (such as G4 and G5)?

    I just bought a PowerMac dual G5, because I didn't see a point going to the Intel based ones, as I could just buy a PC at that point. I was hoping that Mozilla would keep making a browser for the PowerPC based Mac's running 10.5. Seems everyone is di

  • Problems with D-Link DI-604 router

    I have two PCs in my LAN. They both are connected to a router. One PC is running Slackware 10.2 while another is running Arch 7.1 pre1. When I was using Azureus on Slackware one, it caused no problems. Then I have transfered my ~/.Azureus folder to A

  • How to set up fixed height in ADF layout component

    I try to create a page by having my main content at the center of page within a box using a fixed height. The idea is when the content is too long, a vertical scrollbar should show up for that box instead of stretching that box. I tried to use trh:ta