equivalent createjs code as3 hitTestObject

I have two objects circle_mc and square_mc


if (circle_mc.hitTestObject(square_mc))
{
  trace("Collision detected!");

}

What is the equivalent createjs code

Collision detection of EaselJS pixels for bitmaps with Alpha threshold | indiegamr

Tags: Adobe Animate

Similar Questions

  • Where should I put this piece of code AS3?

    Hello

    I have some code AS3 Im using a typewriter in flash effect.

    It is that connects to a separate Word document that contains the text, I would like to use.

    I know that the use of the character/n is a 'new line', but I can't place the code inside the text document. I found the following code which should help me add the line break, where I need:

    If (PosCar == XX) {}
    varString += "\n";
    }

    However, I do not know where abouts in my code, this should go? Ive tried to add in it but I keep getting errors. My code is:

    var myText:String;
    var count: int = 0;


    var format: TextFormat = new TextFormat();
    format. Size = 14;
    format.font = "Georgia."
    format. Color = 0xFFFFFF;
    format. Leading = 1;
    format.letterSpacing = 0.6;


    var textField: TextField = new TextField();
    textField.width = 400;
    textField.height = 400;
    textField.selectable = false;
    textField.wordWrap = true;
    textField.defaultTextFormat = format;
    textField.x = 83;
    textField.y = 127;
    addChild (textField);


    var textLoader:URLLoader = new URLLoader (new URLRequest ("http://www.securedbystothard.com/images/flash_banners/text1.txt"));
    textLoader.addEventListener (Event.COMPLETE, function(e:Event){initText(e.target.data);});)


    function initText(string:String):void {}
    myText = string;
    addEventListener (Event.ENTER_FRAME, writeText);
    }



    function writeText(e:Event):void {}
    If (counter < = myText.length) {}
    textField.text = myText.substr(0,counter);
    counter ++;
    }
    else {}
    removeEventListener (Event.ENTER_FRAME, writeText);
    }
    }


    Someone would be able to tell me where I put the code I found?

    Thank you

    Shaun.

    Here's another approach that uses myText as table with the same effect:

    import flash.events.Event;
    //var myText:String;
    var myText:Array;
    var counter:int = 0;
    
    var format:TextFormat = new TextFormat();
    format.size = 14;
    format.font = "Georgia";
    format.color = 0x000000;
    format.leading = 1;
    format.letterSpacing = 0.6;
    
    var textField : TextField = new TextField();
    textField.width = 400;
    textField.height = 400;
    textField.selectable = false;
    textField.wordWrap = true;
    textField.defaultTextFormat = format;
    textField.x = 83;
    textField.y = 127;
    addChild(textField);
    
    var textLoader:URLLoader = new URLLoader();
    textLoader.addEventListener(Event.COMPLETE, initText);
    textLoader.load(new URLRequest("http://www.securedbystothard.com/images/flash_banners/text1.txt"));
    
    function initText(e:Event):void {
         myText = e.target.data.replace(/\|/g, "\n").split("");
         addEventListener(Event.ENTER_FRAME, writeText);
    }
    
    function writeText(e:Event):void{
         if (counter < myText.length){
              //textField.text = myText.substr(0,counter);
              textField.appendText(myText[counter]);
              counter++;
         }
         else{
              removeEventListener(Event.ENTER_FRAME,writeText);
         }
    }
    
  • codesnippent createjs equivalent of flash as3 drag and drop the code snippet

    AS3 deafult code snippent for drag and drop

    circle.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);

    function fl_ClickToDrag_3(event:MouseEvent):void

    {

    circle.startDrag ();

    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);

    function fl_ReleaseToDrop_3(event:MouseEvent):void

    {

    circle.stopDrag ();

    }

    I just tried to convert this code createjs. but my code does not

    / * js

    var t1 = this;

    {circle.addEventListener ('mousedown', function (e)}

    {stage.addEventListener ('stagemousemove', function (e)}

    T1.x = stage.mouseX;

    T2.y = stage.mouseY;

    });

    {stage.addEventListener ('stagemouseup', function (e)}

    e.target.removeAllEventListeners ();

    });

    });

    */

    are you trying to drag and drop the circle?  If so,.

    var tl = this;

    tl.circle.addEventListener ("mousedown", downF)

    function downF (e) {}

    stage.addEventListener ('stagemousemove', moveF);

    stage.addEventListener ('stagemouseup', upF);

    };

    function upF (e) {}

    stage.removeAllEventListeners ();

    }

    function moveF (e) {}

    TL. Circle.x = stage.mouseX;

    TL. Circle.y = stage.mouseY;

    }

  • Compression external createjs code Flash Canvas library

    Hi guys, please help!

    I created a set of banners using Flash and HTML5 Canvas. I was given a total of 100 KB load and while the exported HTML, js, and image are below it, the operator announcement said that loaded js libraries are too big!

    It seems that flash canvas needs these external libraries to operate:

    < script src = https://code.createjs.com/Easeljs-0.8.1.min.js > (83.4 kb)

    < /script > < script src = https://code.createjs.com/tweenjs-0.6.1.min.js > < / script > (22.5 KB)

    < script src = https://code.createjs.com/MovieClip-0.8.1.min.js > (4.3 KB)

    < /script > < script src = https://code.createjs.com/preloadjs-0.6.1.min.js > < / script > (54.9 KB)

    They also said that the banner should be autonomous, i.e. all local codes to html.

    does anyone know how

    (a) make the local code

    (b) reduce the load of KB in js files?

    Here is a link to one of html5 ad units: display-pl-980 x 300-v3

    Really appreciate ANY help

    see you soon

    Karl

    The CreateJS library has been a single JS file for a few revisions now. Are you sure you're running the 2015.2 version?

  • Auto-scroll CODE AS3 Gallery

    Hello!

    I hope that maybe someone can help me with this. I've created a gallery with scroll buttons which works perfectly. However, I would like to have this auto-scroll (maybe 2 seconds on each image) and I don't know how to do this. My guess is that I'm completely more complicate. I'd like a second pair of eyes to give me an idea how I can do this.

    Thanks a lot for your help in advance.

    THE AS3 CODE

    Stop();

    Arrows.LA.addEventListener (MouseEvent.CLICK, backFrame);

    Arrows.RA.addEventListener (MouseEvent.CLICK, forwardFrame);

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    var nFrame:Number = 1;

    FUNCTIONS OF THE ARROW

    function backFrame(evt:MouseEvent):void

    {

    if(nFrame>1) {}

    -nFrame;

    } else {}

    nFrame = 5

    }

    Arrows.gotoAndStop (nFrame);

    var nX:Number = 0-((nFrame-1) * 379)

    var myTween:Tween = new Tween (Gallery, "x", Strong.easeOut, Gallery.x, nX,.5, true);

    }

    function forwardFrame(evt:MouseEvent):void

    {

    if(nFrame<5) {}

    nFrame ++;

    } else {}

    nFrame = 1;

    }

    Arrows.gotoAndStop (nFrame);

    var nX:Number = 0-((nFrame-1) * 379)

    var myTween:Tween = new Tween (Gallery, "x", Strong.easeOut, Gallery.x, nX,.5, true);

    }

    BUILD FRAMEWORK WORKS

    function frameA(evt:MouseEvent):void

    {

    nFrame = 1;

    Arrows.gotoAndStop (1);

    var myTween:Tween = new Tween (Gallery, "x", Strong.easeOut, Gallery.x, 0,.5, true);

    }

    function frameB(evt:MouseEvent):void

    {

    nFrame = 2;

    Arrows.gotoAndStop (2);

    var myTween:Tween = new Tween (Gallery, "x", Strong.easeOut, Gallery.x, 0,.5, true);

    }

    function frameC(evt:MouseEvent):void

    {

    nFrame = 3;

    Arrows.gotoAndStop (3);

    var myTween:Tween = new Tween (Gallery, "x", Strong.easeOut, Gallery.x, 0,.5, true);

    }

    function frameD(evt:MouseEvent):void

    {

    nFrame = 4;

    Arrows.gotoAndStop (4);

    var myTween:Tween = new Tween (Gallery, "x", Strong.easeOut, Gallery.x, 0,.5, true);

    }

    function frameE(evt:MouseEvent):void

    {

    nFrame = 5;

    Arrows.gotoAndStop (5);

    var myTween:Tween = new Tween (Gallery, "x", Strong.easeOut, Gallery.x, 0,.5, true);

    }

    Best,

    Mel

    call the function that scrolls with the help of a timer with a delay of 2 seconds.  If you click on a button to reset your timer.  change the argument of the function of scrolling to an event instead of MouseEvent or TimerEvent so both work.

  • Flash Pro CC can convert the inline code AS3 FLA HTML5?

    Flash Pro CC isn't able to convert external AS3 codebase in HTML5. It allows to convert written or referenced on timeline Flash AS3 code?

    Laughing out loud

    There are a few limited goto that can be encapsulated in a comment of js that is converted to JavaScript, but for all practical purposes, is not the answer.

  • How to add the stop button in the present code AS3

    Hello, im new to this adobe flash AS3. I want to create a simple solid game using flash + XML file for a site., this is my code

    all of this code are greate job... but I have the problem to add the code to stop_btn my playlist button already have next, thank you and pause and play... only the stop button I fail to create. This is my code

    var my_songs:XMLList;

    var my_total:Number;

    var my_sound:Sound;

    var my_channel:SoundChannel;

    var current_song:Number = 0;

    var song_position:Number;

    var song_paused:Boolean;

    var myXMLLoader:URLLoader = new URLLoader();

    myXMLLoader.load (new URLRequest ("playlist2.xml"));

    myXMLLoader.addEventListener (Event.COMPLETE, processXML);

    processXML function (e: Event): void {}

    var myXML:XML = new XML (e.target.data);

    my_songs = myXML.SONG;

    my_total = my_songs.length ();

    }

    function playSong(mySong:Number):void {}

    myTitle var = my_songs[mySong].@TITLE;

    var myArtist = my_songs[mySong].@ARTIST;

    var myURL = my_songs[mySong].@URL;

    title_txt. Text = myTitle;

    artist_txt. Text = myArtist;

    If {(my_channel)

    my_channel. Stop();

    }

    my_sound = new Sound();

    my_sound. Load (new URLRequest (myURL));

    my_channel = my_sound.play ();

    my_channel.addEventListener (Event.SOUND_COMPLETE, onNext);

    }

    next_btn.addEventListener (MouseEvent.CLICK, onNext);

    function onNext(e:Event):void {}

    current_song ++;

    If (current_song > = my_total) {}

    current_song = 0;

    }

    playSong (current_song);

    }

    prev_btn.addEventListener (MouseEvent.CLICK, onPrev);

    function onPrev(e:MouseEvent):void {}

    -current_song;

    If (current_song < 0) {}

    current_song = my_total-1;

    }

    playSong (current_song);

    }

    pause_btn.addEventListener (MouseEvent.CLICK, onPause);

    function onPause(e:MouseEvent):void {}

    If {(my_channel)

    song_position = my_channel.position;

    my_channel. Stop();

    song_paused = true;

    }

    }

    play_btn.addEventListener (MouseEvent.CLICK, onPlay);

    function onPlay(e:MouseEvent):void {}

    If {(song_paused)

    my_channel = my_sound.play (song_position);

    song_paused = false;

    } else if (! my_channel) {}

    playSong (current_song);

    }

    }

    can help me... Thank you

    stop_btn.addEventListener (MouseEvent.CLICK, onStop);

    function onStop(e:MouseEvent):void {}

    If {(my_channel)

    my_channel. Stop();

    }

    }

  • AS3 hitTestObject using tables

    I have a project with four circles moving randomly on stage (ball_mc1... ball_mc4). There are four walls making a box (wall1... wall4).

    I created arrays for the myCircles and walls.

    When myCircles hit the walls, I would change the meaning of myCircles depending on which wall, they hit.

    I tried without success to the last part of this code:

    Stop();
    walls or boundaries and their table
    var walls: Array = new Array (wall1, wall2, wall3, wall4);
    for (var j: Number = 0; j < walls.length; j ++);

    table backgrounds
    var myCircles:Array = new Array (ball_mc1, ball_mc2, ball_mc3, ball_mc4);
    for (var i: Number = 0; i < myCircles.length; i ++);

    speed maximum X and Y
    var maxSpeedX1:Number = 5;
    var maxSpeedY1:Number = 5;
    var maxSpeedX2:Number = 5;
    var maxSpeedY2:Number = 5;
    var maxSpeedX3:Number = 5;
    var maxSpeedY3:Number = 5;
    var maxSpeedX4:Number = 5;
    var maxSpeedY4:Number = 5;

    adjustment of position X and position Y
    var positionX1:Number;
    var positionY1:Number;
    var positionX2:Number;
    var positionY2:Number;
    var positionX3:Number;
    var positionY3:Number;
    var positionX4:Number;
    var positionY4:Number;
    Table of maximum speed
    var maxSpeedX:Array = new Array (maxSpeedX1, maxSpeedX2, maxSpeedX3, maxSpeedX4);
    var maxSpeedY:Array = new Array (maxSpeedY1, maxSpeedY2, maxSpeedY3, maxSpeedY4);
    combining speed X and Y speed
    var maxSpeed:Array = new Array ((maxSpeedX [0], maxSpeedY[0]), (maxSpeedX [1] maxSpeedY [1]), (maxSpeedX [2], maxSpeedY [2]), (maxSpeedX [3] maxSpeedY [3]));
    Table for the initials X and Y positions
    var positionX:Array = new Array (positionX1, positionX2, positionX3, positionX4);
    for (var m:Number = 0; m < positionX.length; m ++);
    var positionY: Array = new Array (positionY1, positionY2, positionY3, positionY4);
    combining the position X and Y
    var positions: Array = new Array ((positionX [0], positionY[0]), (positionX [1], positionY [1]), (positionX [2], positionY [2]), (positionX [3], positionY [3]));

    for (var k: Number = 0; k < position.length; k ++);
    TIMER FOR MOVEMENT OF CHANGE AND MANAGEMENT

    var: timer = new Timer (1000); every second 1 direction will change
    timer.addEventListener (TimerEvent.TIMER, onTimer);
    Timer.Start ();
    onTimer();
    addEventListener (Event.ENTER_FRAME, onEnterFrame);

    FUNCTION TO MOVE MOVIE CLIP

    function onEnterFrame(event:Event):void
    {
    myCircles [0] .x += positionX [0];
    myCircles [0] = positionY there [0];
    myCircles [1] .x += positionX [1];
    myCircles [1] = positionY there [1].
    myCircles [2] .x += positionX [2];
    myCircles [2] = positionY there [2];
    myCircles [3] .x += positionX [3];
    myCircles [3] = positionY there [3];


    }


    function onTimer(event:TimerEvent=null):void
    {
    positionX [0] = - maxSpeedX1 + 2 * maxSpeedX1 * Math.random ();
    positionY [0] = - maxSpeedY1 + 2 * maxSpeedY1 * Math.random ();
    positionX [1] = - maxSpeedX2 + 2 * maxSpeedX2 * Math.random ();
    positionY [1] = - maxSpeedY2 + 2 * maxSpeedY2 * Math.random ();
    positionX [2] = - maxSpeedX3 + 2 * maxSpeedX3 * Math.random ();
    positionY [2] = - maxSpeedY3 + 2 * maxSpeedY3 * Math.random ();
    positionX [3] = - maxSpeedX4 + 2 * maxSpeedX4 * Math.random ();
    positionY [3] = - maxSpeedY4 + 2 * maxSpeedY4 * Math.random ();

    }

    HERE'S WHERE I NEED HELP!

    hitWalls();
    function hitWalls(event:Event):void
    {
    If (walls [0] .hitTestObject (myCircles [i]))
    {
    myCircles [i] .x += positionX [0];

    }

    }

    Please help me understand how to manage the hitTestObject with the elements of the array.

    German

    Oops, that probably should be:

    Stop();
    walls or boundaries and their table
    var walls: Array = new Array (wall1, wall2, wall3, wall4);
    for (var j: Number = 0; j

    table backgrounds
    var myCircles:Array = new Array (ball_mc1, ball_mc2, ball_mc3, ball_mc4);
    for (var i: Number = 0; i

    speed maximum X and Y
    var maxSpeedX1:Number = 5;
    var maxSpeedY1:Number = 5;


    var maxSpeedX2:Number = 5;
    var maxSpeedY2:Number = 5;
    var maxSpeedX3:Number = 5;
    var maxSpeedY3:Number = 5;
    var maxSpeedX4:Number = 5;
    var maxSpeedY4:Number = 5;

    adjustment of position X and position Y
    var positionX1:Number;
    var positionY1:Number;
    var positionX2:Number;
    var positionY2:Number;
    var positionX3:Number;
    var positionY3:Number;
    var positionX4:Number;
    var positionY4:Number;
    Table of maximum speed
    var maxSpeedX:Array = new Array (maxSpeedX1, maxSpeedX2, maxSpeedX3, maxSpeedX4);
    var maxSpeedY:Array = new Array (maxSpeedY1, maxSpeedY2, maxSpeedY3, maxSpeedY4);
    combining speed X and Y speed
    var maxSpeed:Array = new Array ((maxSpeedX [0], maxSpeedY[0]), (maxSpeedX [1] maxSpeedY [1]), (maxSpeedX [2], maxSpeedY [2]), (maxSpeedX [3] maxSpeedY [3]));
    Table for the initials X and Y positions
    var positionX:Array = new Array (positionX1, positionX2, positionX3, positionX4);
    for (var m:Number = 0; m
    var positionY: Array = new Array (positionY1, positionY2, positionY3, positionY4);
    combining the position X and Y
    var positions: Array = new Array ((positionX [0], positionY[0]), (positionX [1], positionY [1]), (positionX [2], positionY [2]), (positionX [3], positionY [3]));

    for (var k: Number = 0; k
    TIMER FOR MOVEMENT OF CHANGE AND MANAGEMENT

    var: timer = new Timer (1000); every second 1 direction will change
    timer.addEventListener (TimerEvent.TIMER, onTimer);
    Timer.Start ();
    onTimer();
    addEventListener (Event.ENTER_FRAME, onEnterFrame);

    FUNCTION TO MOVE MOVIE CLIP

    function onEnterFrame(event:Event):void
    {
    myCircles [0] .x += positionX [0];
    myCircles [0] = positionY there [0];
    myCircles [1] .x += positionX [1];
    myCircles [1] = positionY there [1].
    myCircles [2] .x += positionX [2];
    myCircles [2] = positionY there [2];
    myCircles [3] .x += positionX [3];
    myCircles [3] = positionY there [3];
    hitWalls();
      
    }

    function onTimer(event:TimerEvent=null):void
    {
    positionX [0] = - maxSpeedX1 + 2 * maxSpeedX1 * Math.random ();
    positionY [0] = - maxSpeedY1 + 2 * maxSpeedY1 * Math.random ();
    positionX [1] = - maxSpeedX2 + 2 * maxSpeedX2 * Math.random ();
    positionY [1] = - maxSpeedY2 + 2 * maxSpeedY2 * Math.random ();
    positionX [2] = - maxSpeedX3 + 2 * maxSpeedX3 * Math.random ();
    positionY [2] = - maxSpeedY3 + 2 * maxSpeedY3 * Math.random ();
    positionX [3] = - maxSpeedX4 + 2 * maxSpeedX4 * Math.random ();
    positionY [3] = - maxSpeedY4 + 2 * maxSpeedY4 * Math.random ();

    }

    FUNCTION hitTestObject
    function hitWalls() {}
    for (var i: Number = 0; i<>
    for (var j: Number = 0; j<>

    {if (Walls [j] .hitTestObject (myCircles [i]))}

    reboundF (j, i);

    }

    }
    }

    }

    function reboundF (j: Number, i: Number) {}

    {Switch (j)}

    case 1:

    .x += myCircles [i] 80;

    break;

    case 2:

    myCircles [i] .x-= 80;

    break;

    case 3:

    myCircles [i] there-= 80;

    break;

    case 4:

    myCircles [i] there = 80;

    break;

    }

    }

  • Help code AS3 for drag and drop quiz

    I have a flash drag and drop quiz I want to add different images to match the correct veribage when users have dropped the case.

    I have text works well when the user deletes the folder (i.e. "Yes, that's correct! ', I'm sorry, is not correct.', 'congratulations, you're done!'")

    I don't know where to start and I was wondering if it was possible to add an image from the library onto the stage when the corresponding text appears on the stage?

    I have AS3 below code I use.

    Thanks for the help in advance!

    1.gif

    ////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

    var startX:Number;

    var startY: number;

    var counter: Number = 0;

    folder_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    folder_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    folder2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    folder2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    folder3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    folder3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    function pickUp(event:MouseEvent):void {}

    event.target.startDrag (true);

    reply_txt.text = "";

    reply_txt2.text = "";

    event.target.parent.addChild (event.target);

    startX = event.target.x;

    startY = event.target.y;

    }

    function dropIt(event:MouseEvent):void {}

    event.target.stopDrag ();

    var myTargetName:String = "target" + event.target.name;

    var myTarget:DisplayObject = getChildByName (myTargetName);

    if (event.target.dropTarget! = null & & event.target.dropTarget.parent == myTarget) {}

    reply_txt.text = "Yes, that's correct!"

    reply_txt2.text = "Donec sed fermentum lorem. Suspendisse potentialit. Pellentesque hendrerit nunc vitae risus vel gravida Nam semper tempor had lorem sed nulla lacinia vel ante vitae commodo. CRAs ac dolor nibh. « ;

    event.target.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    event.target.removeEventListener (MouseEvent.MOUSE_UP, dropIt);

    event.target.buttonMode = false;

    event.target.x = myTarget.x;

    event.target.y = myTarget.y;

                            counter ++;

                } else {}

    reply_txt.text = "I'm sorry, this is not correct.";  

    reply_txt2.text = "Lorem ipsum dolor sit amet, adipiscing elit computer. Surpassing massa tellus, ut euismod urna. Phasellus bibendum pretium porta. Praesent sed elit vel odio dignissim in tortor ultrices. »

    reply_txt3.text = "Try Again";

    event.target.x = startX;

    event.target.y = startY;

                }

    if(counter == 3)

                   ){

    reply_txt.text = ' congratulations, you're done! "

    reply_txt2.text = "";

        }

    }

    folder_mc.buttonMode = true;

    folder2_mc.buttonMode = true;

    folder3_mc.buttonMode = true;

    Yes, to add a library on the stage using actionscript object to assign the object a class, tell ImageClass.  You can then use the new constructor to create an instance, and then add it to the display list:

    var image: ImageClass = new ImageClass();

    addChild (image);

  • code AS3 in breast Clip

    I could code in clip by clicking on movie cilp on stage but in As3, I could not do. Is it limited to the code on the video clip?

    There is no easy way to convert as2 as3.  and if you do not understand as2 very well I think you will do better just check how the as2 swf and then recreate that in as3 without trying to convert the line of code as2 for the line.

  • Code AS3 volume slider doesn't work do not

    I added a volume slider that slides back and forth works, but it does not change the volume. Am I done wrong or missing code? I'm different audio streaming on each image.

    Here is the code on the main timeline:

    SoundMixer.stopAll ();

    var pP1:Number = 0; playback position

    var playing1:Boolean = false;

    var mySound1:Sound = new Sound();

    var myChannel1:SoundChannel = new SoundChannel();

    mySound1.load (new URLRequest ("Physiology Slide 01 INTRO.mp3"));

    myChannel1 = mySound1.play ();

    SoundMixer.stopAll ();

    function EnterFrame(event:Event):void {}

    chnange volume if the drag the volume slider

    var volumeLevel = myChannel1.soundTransform;

    var newLevel:Number = volumeSlider.slideKnob.x / 100

    volumeLevel.volume = newLevel;

    myChannel1.soundTransform = volumeLevel;

    }

    PlayPause1_btn.addEventListener (MouseEvent.CLICK, togglePlay1);

    togglePlay1 (null);

    function togglePlay1(event:MouseEvent):void {}

    playing1 =! playing1;

    If (playing1) playS1();

    of other pauseS1();

    }

    function playS1() {}

    myChannel1 = mySound1.play (pP1);

    PlayPause1_btn.gotoAndStop (1);

    }

    function pauseS1() {}

    pP1 = myChannel1.position;

    myChannel1.stop ();

    PlayPause1_btn.gotoAndStop (2);

    }

    Nevermind, I found this tutorial:

    How to create a Volume slider in Adobe Flash CS6. -YouTube

  • AS3 has the concept of classes of a friend?

    C++ is a concept of classes of a friend. If I remember (long since College), it was a way that you could share a feature with another class and only this other category objects.  Other classes that were not declared as friends could not access the features.  I was wondering if Actionscript had a similar concept.

    I have public methods on some of my classes that exposes the potential pitfalls of clients of my SWF files. So, I'm looking for a way to test my code as my swf/classes files users use them appropriately, the appropriate context.  I don't want to call them the public methods hurt when a given public method was intended to be used by another class.

    Hope this makes since.

    Thank you

    Rick

    There is no equivalent friend in AS3.

  • createJS:Bitmap

    I was watching createJS code for working with images. I'm looking to bring in a bitmap of the image / library. I thought I had found a code to do it, but it does nothing. It compiles, but gives me nothing. Here is the Code, is there a reason why it does not work (the circle was my first try, and I kept it to check that the code was compiled without error).

    Can you bring a picture in this way? If this isn't how to do?

    var circle = new createjs. Shape();

    circle.graphics.beginFill("DeepSkyBlue").drawCircle (0, 0, 50);

    Circle.x = 100;

    Circle.y = 100;

    stage.addChild (circle);

    createjs. Tween.get (circle, {loop: false})

    .to ({x: 200}, 1000, createjs.) Ease.getPowOut (12))

    createjs. Tween.get (this.square_mc, {loop: true})

    .to ({x: 300}, 3000, createjs.) Ease.getPowInOut (12));

    var image = createjs new. Bitmap ("Sandies pic9.png"); In the library

    var MC_Container = new createjs. Container();

    MC_Container.addChild (image);

    MC_Container.x = 100;

    stage.addChild (MC_Container);

    internship. Update();

    It's for loading bitmaps.

    to use an image from the library, give a link id (for example, Sandies_pic9) and use:

    image of var is new lib. Sandies_pic9;

  • Integration of YouTube videos (CS6 / AS3)

    Hi people, I'm trying to create an interactive swf, in which a user can flit between frames, three of sheltering three different videos. Usually, I would do it just convert the FLV, download videos, then by importing the url in Flash - very simple.

    However the client this time only gave me videos that have already been uploaded in YouTube, so I can't access it locally. I did this once before using AS2 and it was pretty painless, but given that YouTube changed their policies, the code that I used at the time no longer works and I had to reuse the ad for AS3. I'm not very well when it comes to actionscript; most of the things I get to do I usually just work them as I get them, but for this I was digging around for the better part of two days now, and I can't for the life of me find a clear answer on how to do it.

    All I need to know is exactly what AS3 code to use, and where exactly, I'm supposed to put it. For example, create a movieclip first and then put the code inside? Or should I create an instance and then referencing in some code on it? Most sons I think just to give you a code, but never really will tell you exactly where to go; I checked on the attached photos what images I want my videos appear in.

    fs.png

    Because you might be able to discern, I already managed to enter actionscript code in basically "gotoAndPlay" - ing the individual frames, so all I need to do is to place the videos of youTube on each specific image, and then I should be sitting pretty!

    Any help would be greatly appreciated.

    Here is a simple piece of code AS3 for the loading of Youtube in Flash videos - link

    Tried with Flash CC - works great!

  • HitTestObject parameter must be null.

    I create a game in which there are 4 buttons. The 4 buttons are baskets with labels of solids, liquids, gas and fire. When the button is clicked, the basket that keeps the catcher/character will change depending on what the button is clicked. The performance of the basket is now correct. I put the change in the animation of the basket inside the character/receiver movieClip and what I do, it's that when I clicked on the desired basket, I call the gotoAndPlay function. Now, my problem is on my hitTestObject. I want solid objects to be catch the solid objects only and so on. But whenever I clicked on the button, the shopping cart will change, but the receiver/character don't move because of this error. What should I do? >. <

    Here is my code in hitTestObject:

    public void moveObjects(e:Event) {}

    for (var i: int = objects.length - 1; i > = 0; i--) {}

    objects [i] there speed +=;

    addChild (objects [i]);

    If (items [i] .hitTestObject (catcher.mouth_mc_2)) {}

    If (items [i] .typestr == 'solid') {}

    score += 5;

    soundfx_1.play ();

    Catcher.mouth_mc_2.gotoAndPlay (9);

    }

    on the other

    {

    score = 5;

    soundfx_2.play ();

    Catcher.mouth_mc_2.gotoAndPlay (2);

    }

    If score (score < 0) = 0;

    ScoreDisplay.text = String (score);

    removeChild (objects [i]);

    Objects.splice (i, 1);

    }

    ElseIf (objects [i] .hitTestObject (catcher.mouth_mc_3)) {}

    If (items [i] .typestr == 'liquid') {}

    score += 5;

    soundfx_1.play ();

    Catcher.mouth_mc_3.gotoAndPlay (9);

    }

    on the other

    {

    score = 5;

    soundfx_2.play ();

    Catcher.mouth_mc_3.gotoAndPlay (2);

    }

    If score (score < 0) = 0;

    ScoreDisplay.text = String (score);

    removeChild (objects [i]);

    Objects.splice (i, 1);

    }

    ElseIf (objects [i] .hitTestObject (catcher.mouth_mc_4)) {}

    If (items [i] .typestr == 'gas') {}

    score += 5;

    soundfx_1.play ();

    Catcher.mouth_mc_4.gotoAndPlay (9);

    }

    on the other

    {

    score = 5;

    soundfx_2.play ();

    Catcher.mouth_mc_4.gotoAndPlay (2);

    }

    If score (score < 0) = 0;

    ScoreDisplay.text = String (score);

    removeChild (objects [i]);

    Objects.splice (i, 1);

    }

    ElseIf (objects [i] .hitTestObject (catcher.mouth_mc_5)) {}

    If (items [i] .typestr == 'fire') {}

    score += 5;

    soundfx_1.play ();

    Catcher.mouth_mc_5.gotoAndPlay (9);

    }

    on the other

    {

    score = 5;

    soundfx_2.play ();

    Catcher.mouth_mc_5.gotoAndPlay (2);

    }

    If score (score < 0) = 0;

    ScoreDisplay.text = String (score);

    removeChild (objects [i]);

    Objects.splice (i, 1);

    }

    ElseIf (objects [i] .hitTestObject (boundary)) {}

    removeChild (objects [i]);

    Objects.splice (i, 1);

    }

    Catcher.x = mouseX;

    checkStageBorder();

    }

    }

    check if objects exist before trying to use them in your hittest.  for example, you can use the following to search all your hittests except the limit.  How you manage the minting of the limit depends on more than one catcher.mouth_mc one exist at the same time:

    public void moveObjects(e:Event) {}

    for (var i: int = objects.length - 1; i > = 0; i--) {}

    objects [i] there speed +=;

    addChild (objects [i]);

    for (var j: int = 2; j<>

    {if (Catcher ["mouth_mc_" + j])}

    If (items [i] .hitTestObject (catcher ["mouth_mc_" + j])) {}

    If (items [i] .typestr == 'solid') {}

    score += 5;

    soundfx_1.play ();

    Catcher ["mouth_mc_" + j] .gotoAndPlay (9);

    }

    on the other

    {

    score = 5;

    soundfx_2.play ();

    Catcher ["mouth_mc_" + j] .gotoAndPlay (2);

    }

    If (score< 0)="" score="">

    ScoreDisplay.text = String (score);

    removeChild (objects [i]);

    Objects.splice (i, 1);

    }

    }

Maybe you are looking for

  • 15-p-152nu HP: Hp driver wifi 15-p-152nu

    Hello I just bought a Hp 15-p-152nu. I have the following problem.I don't have a disk with the drivers and I can't find the wifi driver in the official site of HP. When I click to open the list of drivers it just says: it can take up to 3 minutes and

  • All my icons are direct me directly on my itunes. How can I get it back to normal?

    Tried to put music on a blackberry phone. Chose default itunes somehow and it changed all my icons to itunes. Everything I click on sent me directly to itunes.

  • graphics card for HP Pavilion

    I have HP Pavilion a6700y do I have to buy a low profile to fit in my case im not a big game, but like to play sometimes I Q - core 4 GB ram slot PCIe 300W power supply, I don't want to change my power provide anyone have ideals... and dose it takes

  • Xmas lost password help

    I was preparing my old but in good condition the HP Media Center M7070n for a family in need for Christmas. I had pages of notes, password, etc, but my husband has moved the computer & lost the paperwork.  He struggles with the TV remote, so there is

  • RollerCoaster Tycoon - can't load/save games

    I've had RollerCoaster Tycoon for several years now and it has always worked well.  So I went ahead and installed on my laptop and it worked for several months until one day I couldn't load my saved games and new game, I started I couldn't save. When