SoundJS with Flash HTML5 Canvas - break sound & update the lib?

I'm looking to do some basic audio control in the Flash timeline, exporting HTML5 canvas.

On the frame of 10 I am loading/reading a file with:

audio1 var is createjs. Sound.Play("Sounds/course3_mod1_2.mp3");

Who plays, but then I can't figure out how to make a pause as the beep several frames later at a briefing of the animation to a timeline. I read that there is a method. pause() methods, as well as chassis 50 that I use:

AUDIO1.pause ();

This does not work for me - I must be missing something pretty obvious regarding variables references on the timeline...? In the console of Firefox, I see the JS error:

ReferenceError: audio1 is undefined.

If it's important, the process of publication included "0.5.2.min.js", although I do not have the latest version of CA is "0.6.0.min.js". I'm also very curious how I would update my CC Flash (version 20141) to use this latest version of the library compared with older he current attaches to the HTML code. I guess I can (in the publication settings) uncheck the option 'Hosted libraries', and then manually download new libraries and replace them in the folder. But not this crushed with each publication? And what happens if I still want a link to a hosted version the later?

somascope wrote:

On the frame of 10 I am loading/reading a file with:

audio1 var is createjs. Sound.Play("Sounds/course3_mod1_2.mp3");

Who plays, but then I can't figure out how to make a pause as the beep several frames later at a briefing of the animation to a timeline.

That cannot possibly work. If it worked, it is no more. The SoundJS, the documentation is very clear that "before you can play a sound, it must be saved.» You need to do something like this:

// create global alias to main timeline for event handler
_main = this;
// wait for sound to preload
this.stop();
// assign load event handler
createjs.Sound.on("fileload", handleLoad);
// load and register sound
createjs.Sound.registerSound("mysound.mp3", "soundID");
// play sound and start timeline playing
function handleLoad(event) {
    _main.audio1 = createjs.Sound.play("soundID");
    _main.play();
}

Then, to put in pause/resume, follow these steps:

this.audio1.paused = true; // pause
this.audio1.paused = false; // resume

Reference: is there a pause() method? · Number #200 · CreateJS/SoundJS · GitHub

Note that var creates variables that have only the scope of the framework. To the current scope of timeline, you must use this..

If it's important, the process of publication included "0.5.2.min.js", although I do not have the latest version of CA is "0.6.0.min.js". I'm also very curious how I would update my CC Flash (version 20141) to use this latest version of the library compared with older he current attaches to the HTML code.

DO NOT do it. Each new version of Flash CC publishes the files that target a specific version of the CreateJS library, so try to cram in a different version will certainly break things. But why you are still using Flash CC 2014? You should be able to upgrade to CC animate.

Tags: Adobe Animate

Similar Questions

  • How to restore a bios? accidentally flashed my dm4-2070us by updating the drivers

    How to restore a bios? accidentally flashed my dm4-2070us while update the drivers with insydeflash, ran the configuration automatically thing and my phone then froze... when I type with my keyboard keys don't work to register and there is an occasional clicking sound coming from the touchpad... I would return my dm4-2070us for a new? is it possible to restore my bios? is the damaged mobo etc should I change just for a new?

    If you can exchange it for another, it would be the best thing to do. There are some things to try to save the BIOS, but most of the time, they do not work.

    Do you have important files on the hard drive, there is a way to save those?

    It is also:

    http://h30434.www3.HP.com/T5/notebook-operating-systems-and/bricked-machine-after-BIOS-update/TD-p/679987

  • [HTML5 Canvas] How to change the scene?

    Hello

    I have an animation created in a HTML5 Canvas document. When seen in the browser, it is displayed in the size of the document, which is not surprising, but what I want to do is display the full window size, scaling to fit. Basically, I'm looking for the equivalent AS3 scaleMode and align with the SWF in height and width to 100%. The publication settings is not all the options related to the scaling, so I don't know where to look. How should I do this?

    Thank you!

    -Aaron

    Hi all

    Sensitive scaling options are now part of the HTML5 canvas publication settings in the latest version of animate CC (2015.2)

    See here: new feature summary (June and August 2016)

    Creating ads with CC HTML5 animate: canvas reactivates the scale. Animate Adobe blog

    Update your copy of Animate through the creative application of cloud and try it now!

  • I'm not having implemented the cd with me. How can I update the window components. by mistake I uninstalled the

    I'm not having implemented the cd with me. How can I update the window components. by mistake I uninstalled the

    Reinstall windows components, you've accidentally deleted when you have the game CD with you.

  • Change the order of the children dragged onstage at the library in Flash HTML5 canvas

    Hello

    I'm under the latest version of Flash Pro CC and created a new file using the HTML5 canvas platform in an iMac OSX 10.11.2 running

    I'm learning to code with createjs in a file of HTML5 canvas. I created two symbols (movieClips) and trained on the stage in different layers.

    Now, I would like to change the order so as the background, we're going to the top and those at the top goes down, they put child 0 on index 1.

    When I try to get the console.log index said that the index is - 1 for two children;

    Console.log (this.getChildIndex (this. NomSymbole //Return))-1

    Console.log (this.) GetChildIndex (this.stage.SymbolName)) / / also returns the value - 1

    Children are added to the display list of the scene of the main movieClip?

    It seems like createjs knows that the index of the things she said itself and shows-1 for everything you put in Flash Pro. You can work around this by an addChild. As:

    this.addChild (this.instancename1);

    this.addChild (this.instancename2);

    Then you can get their index number.

  • How to create seekbar for the generation of animation in flash, html5 canvas

    Hello

    I've created an animation in html5 canvas option in flash CC. I want to control the animation by using the seek bar (progress bar). Can someone guide me how to create the same.

    Thanks in advance.

    var totalFrame;
    var unitFrame;
    var unitSlide;
    var playMode;
    var sliderInitX = 0;
    var currMovie = this.parent;
    var _this = this;
    var BarMc = this["barMc"];
    
    function setSlider()
    {
      totalFrame = currMovie.timeline.duration;
      unitFrame = (totalFrame / (BarMc.nominalBounds.width));
      unitSlide = (BarMc.nominalBounds.width) / totalFrame;
    
      _this.sliderBtn.x = sliderInitX;
    
      playMode = true;
      setInterval(function(){onEnter();}, 33);
    
      BarMc.addEventListener("click", onClick);
    
    }
    
    function onClick(evt)
    {
      var stageXpos = stage.mouseX-(58);
      _this.sliderBtn.x = stageXpos;
      var movFrame = Math.round((_this.sliderBtn.x - (BarMc.x-(BarMc.nominalBounds.width/2))) * unitFrame);
      if ((movFrame< currMovie.timeline.duration) && playMode && (currMovie.timeline.position != currMovie.timeline.duration)) {
      currMovie.gotoAndPlay(movFrame);
      } else if (movFrame > currMovie.timeline.duration) {
      currMovie.gotoAndStop(currMovie.timeline.duration);
      playMode = false;
      } else {
      currMovie.gotoAndStop(movFrame);
      playMode = false;
      }
    }
    
    setSlider();
    
    function onEnter(){
      if (playMode) {
      _this.sliderBtn.x = BarMc.x + (unitSlide * currMovie.timeline.position) - (BarMc.nominalBounds.width/2);
      if (_this.sliderBtn.x > (BarMc.x + (BarMc.nominalBounds.width))) {
      _this.sliderBtn.x = (BarMc.x + (BarMc.nominalBounds.width));
      }
      }
    }
    

    name = barMc bar

    and the handle = sliderBtn

  • Flash html5 canvas opens several tabs when the animation loop

    I started to do a little tests using HTML5 canvas and found a problem in a single process.

    I created See the animation 2 images and as a first step framework there is a button.
    then programmed for When you click on the button it opens a new tab in the browser and move to the next framework a loop animation.
    well.
    but when I come back click on the button it opens 2 tabs and do the loop again, even once, I click it it opens 4 tabs and New button and on.
    why this happens and what would a solution?
    Thank you

    Here is the code of the first framework :

    This.Stop ();

    This.button_1.addEventListener ("click", fl_ClickToGoToWebPage);

    function fl_ClickToGoToWebPage() {}
    window.open ("http://www.adobe.com", "_blank");
    }

    This.button_1.addEventListener ("click", fl_ClickToGoToAndPlayFromFrame.bind (this));

    function fl_ClickToGoToAndPlayFromFrame()
    {
    this.gotoAndPlay (2);
    }

    Instead of calling your tab, '_blank', give it a name, like "myTab". Then, when you run the same code again, it will make the link open in the same tab instead of opening a new.

  • Help with code to insert, and then update the form table.

    I have a form where a user can add a new record in a table. Here is the procedure for recording button that works very well. But I call another procedure for updating the table with an "if" statement "The SQL code that I use works fine to get the data I'm looking for when I run it in SQL, but the 'if' statement updates all records in the table to ' n ' when some should be"Y". I am new to Oracle forms development (3 months) so it's probably very simple, but I'm stuck and need to get this finished form. Any help is greatly appreciated.


    SAVE BUTTON TRIGGER PROCEDURE:*.

    PROCEDURE SAVE_MM_1099_ADD IS

    MM1099_NO NUMBER (10);
    NUMBER OF THE YEAR (4);
    NUMBER OF NOTICE_SEQ_NO (10);
    NOTICE_NAME VARCHAR2 (30);
    TIN_FROM_DB VARCHAR2 (23);
    TSDI_DB VARCHAR2 (1);
    IRS_NTYPE VARCHAR2 (10);
    IRS_NDATE VARCHAR2 (10);
    BU_WH VARCHAR2 (1);
    NO_TIN_NAME VARCHAR2 (1);
    DUP_IRS_NOTICE VARCHAR2 (1);
    G1_IRS_NOTICE_3YR_2BS VARCHAR2 (1);

    B_SAVE_ADD boolean;

    Start

    IF MM1099_NO IS NOT NULL THEN

    insert into MM_1099
    (
    MM1099_NO,
    YEAR,
    NOTICE_SEQ_NO,
    NOTICE_NAME,
    TIN_FROM_DB,
    TSDI_DB,
    IRS_NTYPE,
    IRS_NDATE,
    BU_WH,
    NO_TIN_NAME,
    DUP_IRS_NOTICE,
    G1_IRS_NOTICE_3YR_2BS
    )
    values
    (
    MM1099_NO,
    YEAR,
    NOTICE_SEQ_NO,
    NOTICE_NAME,
    TIN_FROM_DB,
    TSDI_DB,
    IRS_NTYPE,
    IRS_NDATE,
    BU_WH,
    NO_TIN_NAME,
    DUP_IRS_NOTICE,
    G1_IRS_NOTICE_3YR_2BS
    );


    : system.message_level: = '5';
    Commit_FORM;
    : system.message_level: = '0';

    END IF;

    UPDATE_NUMOCCURTIN;

    END;

    PROCEDURE CALLED:*.

    PROCEDURE UPDATE_NUMOCCURTIN IS

    CURSOR c1 (NUMBER NUMOCCURTIN) IS
    SELECT THE YEAR, TIN_FROM_DB, COUNT (TIN_FROM_DB) AS NUMOCCURTIN
    OF MM_1099
    TIN_FROM_DB GROUP, YEAR
    SEEN (COUNT (TIN_FROM_DB) > 0);

    CR1 c1% ROWTYPE;
    number of v_recs;
    NUMBER OF NUMOCCURTIN;

    BEGIN
    v_recs: = 0;

    OPEN c1 (NUMOCCURTIN);

    loop

    Fetch c1 into cr1;
    When the % notfound c1 or c1% rowcount output > v_recs;

    IF cr1. NUMOCCURTIN > 1 THEN

    UPDATE MM_1099
    SET DUP_IRS_NOTICE = 'Y ';

    ON THE OTHER

    UPDATE MM_1099
    SET DUP_IRS_NOTICE = 'N';

    : system.message_level: = '5';
    commit;
    : system.message_level: = '0';

    END IF;

    v_recs: = v_recs + 1;

    END LOOP;

    CLOSE c1;

    END;

    For any help or suggestion will be greatly appreciated.

    IF cr1. NUMOCCURTIN > 1 THEN

    UPDATE MM_1099
    SET DUP_IRS_NOTICE = 'Y ';

    ON THE OTHER

    UPDATE MM_1099
    SET DUP_IRS_NOTICE = 'N';

    : system.message_level: = '5';
    commit;
    : system.message_level: = '0';

    END IF;

    There is no WHERE condition in your update, so always update you all THE RECORDS in your table. I guess it must be something like:

    UPDATE MM_1099 SET
      DUP_IRS_NOTICE = 'Y';
     WHERE TIN_FROM_DB=cr1.TIN_FROM_DB
       AND YEAR=cr1.YEAR
    

    Some general order questions about your code:
    Where your variables for your insert statement are filled? looking at your code they will always be NULL.
    Be careful when using the variable exactly as the names of column names. This may cause unexpected behavior (for example when it is used in the UPDATE statements).
    Why engage in the other branch, but not in the branch so?

  • Can Flash for html5 canvas - I contact of the canvas to the parent page?

    I have several buttons inside my canvas. I want them, when you click on it, to make a hidden div visible on the parent html page, then highlight the point correct in this div is there a way to do that - in General to communicate via js of in a canvas to the parent html page?

    It is not only possible, it's trivial. What generates Flash in Web mode is bog-standard HTML and JavaScript. The execution of the page is not managed to "in" the drawing area. The canvas is literally just a "" tag inspired by Flash (via the library of CreateJS). Out of control are managed by included JS libraries and what is the code you write yourself. It's not like AS2/AS3, where you are forced to communicate with JS via an intermediate layer. In canvas mode it is just a great JS family. So for your button, you might have something like:

    function fl_MouseClickHandler() {
        myDiv = document.getElementById("myDiv");
        //do whatever to the div
    }
    
  • Publishing HTML5 Canvas banner to the DCM.

    Hello

    I made a HTML5 Canvas banner and it works without any problem when I publish. The preview works well, when I download to test the banner in Google DCM.
    The Uni canvas background color shows up, and the "clickTAG" works, but the animation is not displayed.

    Any ideas on how I can fix this!

    Someone at - it a similar situation with Flash HTML5 Canvas to DCM?

    Help, please. Thank you

    PS: I looked at all the directives and documents to respect my banner to the rules, but still it does not work correctly...

    DCM comes out a validator tool that should be useful for a lot of people: DoubleClick campaign manager | HTML5 Validator

    There is one for DBM too: Director of the candidacy of DoubleClick. HTML5 Validator

  • Converted file from Flash to HTML5 Canvas does not publish

    Hello

    • I use a Mac.

    • I have an existing Flash file, operation which publishes fine.

    • Convert to HTML5 Canvas using the command-> convert to other Document Formats-> HTML5 Canvas

    • Do not make any changes to the settings of the HTML5 Canvas publication

    • Select "publish."

    ... The .html file displays only a blank white block, the size of the Flash file.

    I tried:

    • Create a new HTML5 Canvas file and paste the existing content in this

    • Copy the script action layers of the original in the Web a Flash file

    • Check the settings of publication for something unusual

    Any help is appreciated.

    Looks like the JSON file which poses problem. You can disable the spritesheet option in settings of publication, and then your multiple bitmap files can operate locally as well.

    Regarding Javascript errors, those that are produced inside the code CreateJS, you wouldn't want to be messing around with it! They are only security errors, or the consequence of something that does not not due to security restrictions. You will not get the errors when files are online, or if you can disable the sprite sheets, I suspect.

  • Problem with button Flash HTML Canvas document click on opening multiple browser windows

    Here is the code I use. When I click on the buttons, they open a new browser window.

    If I go back to the new buttons and click on them, they open two browser windows.

    If I repeat the process again a click will open three windows, etc. etc.

    It does in 6.1.6 Safari and in Firefox 35.0.1 but it functions correctly - just open a browser by clicking window, in Google Chrome.

    What I'm doing wrong or is it a problem with the browsers themselves?

    / * Click here to go to the Web Page

    Click on the specified symbol instance loads the URL in a new browser window.

    Directions for use:

    1. replace http://www.adobe.com with the desired URL.

    Keep the quotation marks ("").

    */

    this.learnMore2.addEventListener ("click", fl_ClickToGoToWebPage_6);

    function fl_ClickToGoToWebPage_6() {}

    window.open ("http://www.google.com", "_blank");

    }

    / * Click here to go to the Web Page

    Click on the specified symbol instance loads the URL in a new browser window.

    Directions for use:

    1. replace http://www.adobe.com with the desired URL.

    Keep the quotation marks ("").

    */

    this.bookingRequest2.addEventListener ("click", fl_ClickToGoToWebPage_7);

    function fl_ClickToGoToWebPage_7() {}

    window.open ("http://www.apple.com", "_blank");

    }

    Gotcha now.

    I found this thread, can be to the address you are looking for.

    Flash html5 canvas opens several tabs when the animation loop

  • Resize the image with HTML5 Canvas - distortion

    Hi all

    I'm working on a Webworks app where I need to resize an image to upload it to a server. I use JQuery Mobile, the application should run on OS6 and upward. The user can use the camera or select a picture, the power off. The corresponding code is the following:

    function handleOpenedFile(fullPath, blobData) {
                    var image = new Image();
                    image.src=fullPath; //path to image
                    image.onload = function () {
                        var resized = resizeMe(image); // send it to canvas
                        //Do stuff with the DataURL returned from resizeMe()
                    };
            }
    
    function resizeMe(img) {
    
                var canvas = document.createElement('canvas');
                var width = Math.round(img.width / 2);
                var height = Math.round(img.height / 2);
                canvas.width = width;
                canvas.height = height;
                var ctx = canvas.getContext("2d");
                ctx.drawImage(img, 0, 0, width, height);
                return canvas.toDataURL("image/jpeg", 0.8);
            }
    

    I then use the Base64 in the DataURL for download on the server. The images are reduced, but they are truncated. Parts of the image are shifted autour and colors come out strange. It is not scaling in itself than the mess to the top of the picture it comes out garbled if you draw on the canvas without any scaling.

    Does anyone have an idea how to solve this problem or have another suggestion to resize an image for download?

    I managed to solve the problem of resizing for anyone who takes place also in this. Replacement of

    return canvas.toDataURL("image/jpeg", 0.8);
    

    with

    return canvas.toDataURL();
    

    solved the problem with the strange visual artifacts. Returns a picture of resized without any strangeness.

  • gotoAndPlay ("label") going on at different times of second click HTML5 canvas

    I have a very strange problem, I can't seem to understand.

    I work in CC animate with a HTML5 canvas.  I made a simple interactive slideshow that a user can jump around in.  Instead of going to the chassis numbers, I use labels for each button.  My key codes look like this:

    This. SL01_01But.addEventListener ("click", fl_ClickToGoToAndPlayFromFrame_2.bind (this));

    function fl_ClickToGoToAndPlayFromFrame_2()

    {

    createjs. Sound.Stop ();

    this.gotoAndPlay ("Slide02");

    }

    I have to stop the sound, then go and play an image tag.  It works on the first click, however, if the user sees this new framework, on the second click goes to the next section (the one after the label).  For the life of me I can't understand why.  Any ideas?

    So what you see is expected.

    you will stop on Slide02.  and then a gotoAndPlay will leave Slide02 and get arrested on the following image, before he gets to Slide02 again.

    That is to say, your gotoAndPlay runs and then the this.stop () runs in the Slide02 more 1 frame.

    to remedy this, use this.gotoAndStop ('Slide02') for not going out when rerun.  But if you really want to get out and then re-enter that govern when you could use:

    this.gotoAndStop(this.currentFrame+1);

    this.gotoAndStop ('Slide02');

    Any reason you have to want to do this is probably better handled by other code.

  • Onmouseover - HTML5 Canvas Javascript popup box

    Hello!

    I play with the event onmouseover with javascript in cc pro flash html5 canvas.

    I would like a box into the pop-up window and stay until there is no onmouseover more. I think he called a description area.

    My two symbols are "Box1" and "Box2".
    I want Box2 ontop Box1 popup when I put my mouse on Box1 and box 2 to disappear as soon as I move the mouse off zone 2.

    I am using this code:

    var e = document.getElementById ('Box1');

    e.onmouseover = function() {}

    document.getElementById('Box2').style.display = 'block ';

    }

    e.onmouseout = function() {}

    document.getElementById('Box2').style.display = 'none ';

    }

    HOORAY!
    I found my own answer, here it is...

    This. Box2.visible = false;

    This. Box1.addEventListener ('mouseover', fl_MouseOverToShow.bind (this));

    function fl_MouseOverToShow() {}

    This. Box2.Visible = true;

    };

    This. Box2.addEventListener ("mouseout/mouseouthandler()", fl_MouseOutToHide.bind (this));

    function fl_MouseOutToHide() {}

    This. Box2.visible = false;

    };

Maybe you are looking for

  • About Grapher

    Hi, I tried to graph of the entire greater function Grapher. However, I discovered that I can't put 'int' as a valid command. Here is the image that shows what it looks like on calculator TI-84. So, I was wondering if there is another symbol that can

  • iTunes Store stuck download

    I recently bought an iPad mini 4.  In the iTunes Store began downloading the songs and then stopped these songs (an album) are no longer available in the store.  I can't remove the stuck downloads.  IPad power off (by pressing home and the button sim

  • Macbook Air color print

    My Macbook Air will not give me the option to print to my HP 5550 color.  I tested the printer test page and this in fact print in color, so I know this isn't my printer.  I've seen this problem on other threads, and I tried many suggestions from use

  • Satellite L100 113 does not start after upgrading memory

    Hello. Our Integrator bring to our company KVR800D2S5, but laptop memory modules does not start :( I read manual - this laptop supports 533 PC4200 memory modules. But SO-DIMM 533 MHz will be delivered in one month... The memory modules, we can instal

  • Need drivers of Windows XP Home for my Satellite A350 - 11 c

    Hello I'm French. I have a Toshiba Satellite A350 - 11 c and would like to downgrade my pc to Windows XP, but I can't find any driver for WinXP.Where to download? Or driver Vista is compatible with Windows XP? Thank you bye