Create cartoon using AS2 code only. WOW but...

Hi guys.
Some lovely code I picked up to create cartoons. My character is sunny. We create multiple empty mcs as holders for a) Sounds and b) Attached or loaded mcs.
BUT the damn sound object doesn't work.
sound_1.start(); diesn't work - however it works it I move it right up under the attachsound code.
Then the next sound_2.start definately work.
I DID get to work in other code I had even though it was even inside a function. I will paste it under this code.
numOfSounds = 5;
numOfObjects = 5;
objectPath = "images";
_root.createEmptyMovieClip("soundLib", 1);
for (var i:Number = 1; i<=numOfSounds; i++) {
soundLib.createEmptyMovieClip("holder_"+i, i);
_root["sound_"+i] = new Sound(soundLib["holder_"+i]);
sound_1.attachSound("1");
sound_2.attachSound("2");
sound_3.attachSound("3");
sound_4.attachSound("4");
sound_5.attachSound("5");
//sound_1.start(0, 999);// only for bg music
_root.createEmptyMovieClip("objectLib", 1);
for (var i:Number = 1; i<=numOfObjects; i++) {
objectLib.createEmptyMovieClip("holder_"+i, i);
_root["object_"+i] = (objectLib["holder_"+i]);
object_1.attachMovie("sunny", "sunny", 1);// object1 is the empty mc and sunny is the linkage name and sunny is the instance name - usually called something different.
loadMovie(objectPath+"/cat_a.swf", object_2);
loadMovie(objectPath+"/cow_a.swf", object_3);
loadMovie(objectPath+"/bird_a.swf", object_4);
loadMovie(objectPath+"/pig_a.swf", object_5);
object_1._x=500// Sunny
object_1._width=50
object_1._height=50
object_2._x=200
object_3._x=300
object_4._x=400
object_5._x=500
object_1._y=100// loop and use spacing
object_2._y=200
object_3._y=300
object_4._y=400
object_5._y=500
sound_1.start();
object_1.sunny.gotoAndPlay("speak
sound_1.onSoundComplete = function() {
_root.object_1.sunny.gotoAndPlay("static");
sound_2.start();
sound_2.onSoundComplete = function() {
sound_3.start();
_root.sunny.gotoAndPlay("speak");
The sound code on its own DID work - I paste it here
numOfSounds = 5;
_root.createEmptyMovieClip("soundLib", 1);
for (var i:Number = 1; i<=numOfSounds; i++) {
soundLib.createEmptyMovieClip("holder_"+i, i);
_root["sound_"+i] = new Sound(soundLib["holder_"+i]);
// use sound_1.loadSound to load externally.
//For my dialogues only need one movie clip and load into as you need - remember to unload sound as welll
sound_1.attachSound("1");
sound_2.attachSound("2");
sound_3.attachSound("3");
sound_4.attachSound("4");
sound_5.attachSound("5");
//sound_1.start(0, 999);
sound_1.start();
_root.sunny.gotoAndPlay("speak");
sound_1.onSoundComplete = function() {
_root.sunny.gotoAndPlay("static");
sound_2.start();
_root.r.nextFrame();
sound_2.onSoundComplete = function() {
_root.r.gotoAndStop(2);
sound_3.start();
_root.sunny.gotoAndPlay("speak");

sound_2.onSoundComplete = function() {
//sound_3.start();
_root.object_1.sunny.gotoAndPlay("happy");
var my_timedProcess:Number = setTimeout(my_delayedFunction, 2000);
function my_delayedFunction() {
  _root.object_1.sunny.gotoAndPlay("laugh");
Good - after 2 seconds it calls the next behavour ie: she's happy the she laughs.
BUT - This means that everytime I change from one behaviour to another I MYSELF have to tell flash when to change. This is no event triggered at the end of a nested animation I take it (like the onSoundCompleted for sounds)
So I will have to calculate via frames per second example a 48 frames behaviour with frame rate of 24ps would be 2 seconds ie: 2000. BUT I have been told there can be a lag in flash movies on the internet therefore I didn't want to rely on his method. If there is a lag I could possibly call the next function too early cutting off for example the walk cycle.
By the way if I do use this method I would not need to use the clearTimeout would I?
XHEERS for all your wonderful help - I really do appreciate it.

Similar Messages

  • Create unx using program code

    Hi,
    We are using BOBJ 3.1 and using Designer SDK reference in .net application to create universe (.unv) by .net code. Now, we have to move with BOBJ 4.1 and need to create .unx using .net application. Can anyone guide me how to do. I am trying to find IDT api reference but not getting anything. Please suggest.
    Thanks,
    Pankaj

    Hello Pankaj,
    Unfortunately there is no .NET SDK available as of now for create UNX universe. But you can use Semantic Layer Java SDKs for building UNX universe from scratch.
    This SDK is available from BI 4.1 onwards. You can find all the Semantic Layer Java SDKs resources from the below link in the section Developer Documentation: Java:
    SAP BusinessObjects Business Intelligence platform 4.1 – SAP Help Portal Page
    You can download the relevant resources according to your environment specification.
    The other part that you can use is Semantic Layer REST SDKs. You can use .NET application for consuming the Semantic Layer REST Web services SDKs, but it doesn't gives you that level of flexibility which is provided through Semantic Layer Java SDKs(like creating universe from scratch, edit business layer, add/delete/refresh objects in DataFoundation etc.). You can also explore the functionality of Semantic Layer REST Web Service SDKs by following the link. The Semantic Layer REST Web Services is available from the BI 4.1 SP 2 onwards.
    Hope this helps.
    Thanks,
    Shailendra

  • Create application using backend code

    how to create application in excel using java backend code

    This is a forum for sql server.  Please post your question to a more appropriate forum - perhaps one for java?

  • How to create PR using T.code CJ20N

    Dear all,
    I am a MM guy, i want to test the scenario in my IDEAS system
    how to create a PR with CJ20N t.code,based on that i want to create PO to vendor please provide me detials steps .
    Please consider me as a Enduser
    if any documentation please send to svgk111@gmail
    points will be rewarded
    Regards
    venu gopal
    Edited by: venu kk on Jun 26, 2008 7:35 AM

    Hi Venu,
    Reply given by Rahul Tyagi is correct. Another way to get PR thru CJ20N is :
    Open CJ20N , Open your Project by clicking onto the Open Icon --> Click on the network --> Put the description of the PR in the description field > Put WBS element in the WBS element field by taking the columns to the right hand side.> Select the particular line item --> Click on to the Component Overview icon at the bottom --> Put your MM into the Material Field --> Put the requirement qty. -->Now select the item category as L for Stock Item and N for Non Stock
    item , then one POP UP window will appear --> Select " Third Party Order" --> Then put your customer number and press enter --> Save the document.
    Now , again open CJ20N and select the particular Activity ---> select the material component attached to that activity and on the right hand screen  you can see the PR number.
    Hope this will also help you
    Regards,
    Dhruv Kumar Malhotra

  • Problems in creating dir using applet

    hi
    i'm getting various exceptions while creating a new directory
    i know that an applet can not create dir directly because of some
    security . But what if i want to create it using the applets only??
    how to do it??
    Thanx in advance
    Ashish

    To answer your question I would need to know what stack trace comes back with.
    I also need to know the set up.. Is the applet running on you personal machine and what operating system are you using.
    Lee

  • 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.

  • Change as2 code to as3

    I used a tutorial http://www.flash-game-design.com/flash-tutorials/funky-flash-website-tutorial-5.html to make a menu for my application, I've tried following tips on how to change AS2 code to AS3, but it just doesn't work.
    menu = ["bulls", "about", "roster", "schedule"];
    var current = menu[0];
    for (var i = 0; i<menu.length; i++) {
    var b = menu[i];
    this[b+"_btn"].stars._visible = false;
    this[b+"_btn"].txt = b;
    this[b+"_btn"].onPress = function() {
    _root.site[current+"_btn"].stars._visible = false;
    _root.site[this.txt+"_btn"].stars._visible = true;
    current = this.txt;
    _root.site.content.gotoAndStop(this.txt)
    this[current+"btn"].stars._visible = true;
    this.onEnterFrame = function() {
    this[current+"_btn"].stars.s1._rotation += 1;
    this[current+"_btn"].stars.s2._rotation += 0.5;
    Thank you,
    Glenn

    Just a note. Function declarations in a loop is an EXTREMELY bad practice that will lead to many problems if it doesn't have some already. So, the following lines:
    for (var i:int = 0; i<menu.length; i++) {
        var b:String = menu[i];
        this[b+"_btn"].stars.visible = false;
        this[b+"_btn"].addEventListener(MouseEvent.CLICK,fn);
        this[b+"_btn"].txt=b;
        function fn(e:MouseEvent):void{
            this[current].stars.visible = false;
            var nam:String=e.target.parent.name;
            this[nam].stars.visible = true;
            current = nam;
            //MovieClip(root).site.content.gotoAndStop(this.txt)
    should be:
    for (var i:int = 0; i < menu.length; i++) {
         var b:String = menu[i];
         this[b+"_btn"].stars.visible = false;
         this[b+"_btn"].addEventListener(MouseEvent.CLICK,fn);
         this[b+"_btn"].txt=b;
    function fn(e:MouseEvent):void {
         this[current].stars.visible = false;
         var nam:String=e.target.parent.name;
         this[nam].stars.visible = true;
         current = nam;
         //MovieClip(root).site.content.gotoAndStop(this.txt)

  • Created Graphics Using InDesign's Drawing Tools

    Hello,
    I Created Graphics Using InDesign’s Drawing Tools, but when I published to Kindle or EPUB, the graphics do not appear?  All other raster images that are on the same page appear in Kindle Previewer.  Is there a hidden button I must enable for Graphics created with InDesign’s own tools to get them to publish to Kindle?
    Any help would be greatly appreciated.
    Thanks
    iaustin

    I tried your suggestions(group, achor) and it still did not resolve my Kindle image issue.
    I also tried exporting to EPUB format and the InDesign created images appear as drawn.
    I conclude that have a Kindle ONLY related issue. (Tried in both PC Kindle and Amazon previewers).
    I wonder what else can I try?
    Can you clarify your statement... "but at least one line above where the images are visible?"

  • Help! Convert simple Flash AS2 code to AS3

    Hi everyone,
    I'm a Flash beginner and followed a tutorial: http://www.webwasp.co.uk/tutorials/018/tutorial.php ... to learn how to make a "live paint/draw" effect. I didn't realize  that if I made something in AS2, I wouldn't be able to embed it (and  have it work) into my root AS3 file, where I've got a bunch of other  stuff going on. I've tried following tips on how to change AS2 code to  AS3, but it just doesn't work. I know it's simple code, and that some  genius out there can figure it out, but I'm at a loss. Please help!
    Here's the AS2 code:
    _root.createEmptyMovieClip("myLine", 0);
    _root.onMouseDown = function() {
       myLine.moveTo(_xmouse, _ymouse);
       ranWidth = Math.round((Math.random() * 10)+2);
       myLine.lineStyle(ranWidth, 0xff0000, 100);
       _root.onMouseMove = function() {
          myLine.lineTo(_xmouse, _ymouse);
    _root.onMouseUp = function() {
       _root.onMouseMove = noLine;
    Thanks in advance!
    Signed,
    Nicolle
    Flash Desperado

    Considering the code is on timeline:
    var myLine:Sprite = new Sprite();
    addChild(myLine);
    var g:Graphics = myLine.graphics;
    addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
    function onMouseDown(e:MouseEvent):void {
         var ranWidth:Number = Math.round((Math.random() * 10) + 2);
         g.clear();
         g.lineStyle(ranWidth, 0xFF0000, 1);
         addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
    function onMouseMove(e:MouseEvent):void {
         g.lineTo(mouseX, mouseY);
    function onMouseUp(e:MouseEvent):void {
         removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);

  • Creating Repositories using MS SQL Server DataBase in Data Service Reposito

    HI All,
    I installed BODS and I am trying to create repository using Data Service Repository Manager but I am getting the following error message :
    Cannot open connection to the repository.  The error message from the underlying DBMS is <ODBC call <SQLDriverConnect> for data source <localhost> failed: <[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.>. Notify Customer Support.>. (BODI-20006)
    An error occurred during creation of the local repository. (BODI-300054)
    While installing BODS i used the option to create DB .... Before that even I had Microsoft SQL server installed for MDM which was working fine (Able to Log on and so on)...
    Do I need to install Oracle in order to create repositories? How to proceed further please suggest.
    many Thanks
    Rajeev.

    Hi!
    What version of SQL Server are you using for the repositories? Maybe the error is because DS can not create repositories in SQL Server 2008. You can read and write data with SQL2008, but you need to create the repositories in SQL2005 or another RDBMS. I'm not sure when DS is going to be able to create them in SQL2008.
    I hope this could help you. Greetings!
    See you
    LCGC

  • Do  new  FLASH CS3  support s AS2  codes ?

    Hi folks . . .
    When we use AS3 development tools , will old flash codes (
    AS1 and AS2 ) work correctly after this ?
    And can we use AS2 codes by flash cs3 tools ?
    Do ADOBE support AS1 and AS2 codes for a long time ??

    Yes. Flash CS3 is pretty much Flash 8 with new features and
    support for what
    it supported before (AS1 and AS2) and more (now additionally
    AS3)
    "firatadobeturk" <[email protected]> wrote
    in message
    news:f2l4f9$9i3$[email protected]..
    > Hi folks . . .
    > When we use AS3 development tools , Do old flash codes (
    AS1 and AS2 )
    > will work correctly after this ?
    > For a long time , does ADOBE supports , AS1 and AS2
    codes?
    >

  • How to show ipad application in itunes, but will only be assessable to owners, not the general public.Using lock code/password protected on iTunes

    How to show ipad application in itunes, but will only be assessable to owners, not the general public by using lock code/password protected on iTunes

    So if I understand you properly, I need to create EOs for all my list of values (which are based on views of Oracle apps tables) and base my VO on those EOs. And then I setup associations between these EOs and the Item EO. Then I include the these EOs in my Items VO and add the description attributes to my list of attributes. I had done this for the list of users, but for the views of Oracle I had just created read only VO. Sounds like that won't work if I want to display the description. I know what to do - I guess I was hoping there was a way to use the read only VO.
    Thanks
    Karen

  • I have created a group in my address book, but when I try to use it to send out a group email, only a comma shows up. How do I send out an email using my new group contact list?

    I have created a group in my address book, but when I try to use it to send mail, only a comma shows up. How can I send mail using my new group? I have an IMac with OSLion.

    I will agree with you on this one. Version 31 and all the fixes so far are a mess. Since I have been here answering questions for a little more than a year now I have learned to wait to upgrade until all the dust settles. I see no end to the dust storm version 31 has caused. I am still on version 24.6 and plan on staying there for the duration. At least until the developers comes to their senses and put out a working product.

  • I used a code i got with my moive to download the itunes version and i was watching the itunes extras, but now when i click on "play itunes extras" it plays the audio but the only thing it displays is the first frame (the movie is catching fire)

    i used a code i got with my moive to download the itunes version and i was watching the itunes extras, but now when i click on "play itunes extras" it plays the audio but the only thing it displays is the first frame (the movie is catching fire) i deleted the movie and reinstalled from my icloud backup and it still does the same thing. The actual movie works fine, its just the itunes extras

    Hi there MickeyDresaj,
    You may find the troubleshooting steps in the article below helpful.
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/ts1718
    -Griff W. 

  • I have a Adobe Creative Cloud's code, this is alphanumeric, but the registry only works with numeric codes ¿where i can use my code?.

    Hi, i have a problem with my Adobe Creative Cloud's code, this is alphanumeric, but the registry only works with numeric codes ¿where i can use my code? is a year-long Creative Cloud subscription.

    You most likely have a redemption code... especially if you did not buy direct from Adobe
    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    -or https://forums.adobe.com/thread/1572504

Maybe you are looking for