Click here to Skip to main content
15,889,872 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: mouseout isn't firing Pin
Kornfeld Eliyahu Peter30-Jun-14 7:11
professionalKornfeld Eliyahu Peter30-Jun-14 7:11 
AnswerRe: mouseout isn't firing Pin
User 483504730-Jun-14 8:41
User 483504730-Jun-14 8:41 
AnswerRe: mouseout isn't firing Pin
Kornfeld Eliyahu Peter30-Jun-14 9:21
professionalKornfeld Eliyahu Peter30-Jun-14 9:21 
GeneralRe: mouseout isn't firing Pin
User 483504730-Jun-14 9:49
User 483504730-Jun-14 9:49 
AnswerRe: mouseout isn't firing Pin
Kornfeld Eliyahu Peter30-Jun-14 9:58
professionalKornfeld Eliyahu Peter30-Jun-14 9:58 
GeneralRe: mouseout isn't firing Pin
ThetaClear1-Jul-14 1:10
ThetaClear1-Jul-14 1:10 
AnswerRe: mouseout isn't firing Pin
DecompileCodex18-Jul-14 21:19
DecompileCodex18-Jul-14 21:19 
QuestionS code to have an image with different clickable points that play sound Pin
Jennifer Estrada26-Jun-14 13:27
Jennifer Estrada26-Jun-14 13:27 
I have a code that works, but I need to find another way of writing the JS. The code has 1 image, but 4 mp3 for sounds. There are different dots on the image that when you click on the dots should be a different sound.

html part:

XML
<html>
<head>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <title>OdysseyWare</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="" ie="8">
    <link href="/globmedia/ow/css/main_2012_12_12.css" rel="stylesheet">
    <link href="/globmedia/ow/css/curric_2012_12_12.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/globmedia/lib/jquery-ui/css/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css">
    <link href="/globmedia/lib/jquery/css/magnific-popup.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/globmedia/lib/jquery/js/jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript" src="/globmedia/lib/jquery-ui/js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
    <script type="text/javascript" src="/globmedia/lib/requirejs/js/require.js" type="text/javascript"></script>
</head>
<body id="body">

    <div id="section_0" style="margin: 0px auto; width: 970px">
        <div class="presentation">
            <presentation>
                <div class="section">
                    <h3>Test 1 New</h3></div>
                    <p>However, the introduction and conclusion to "The Way to Wealth"   show that the author’s
            advice is presented in a somewhat ironic way. While the crowd that has gathered to listen to
            Father Abraham agrees with him until the "vendue," or sale, begins, they forget the old man’s
            and begin to "buy extravagantly."</p>
                    <p style="TEXT-ALIGN: center">
                        <div id="test1" data-asset-basepath="media/html5" data-data-basepath="media/html5" data-media-basepath="/globmedia"  data-am-controller="media/html5/test1/js/test1.js"  style="border: 1px solid black; margin-right: auto; margin-left: auto;"></div>
                    </p>
                </div>
            </presentation>
        </div>
    </div>

    <script type="text/javascript">
        require.config({
            baseUrl:'/globmedia'
        });
    </script>

    <script type="text/javascript" src="/globmedia/html5/animationmanager/js/animationmanager.js"></script>
</body>
</html>


js part

C#
/*globals require */
(function(doc){

    'use strict';

    return function init(){

        var _this = this;

        //require in the require module itself and creatjs
        require(['createjs','SimpleInteractiveAnimationModule', 'jquery'],function(c, _anm, jq){
                        var queue = [{id:_this.id + 'audio1',src: _this.assetBasePath + '/test1/media/roles-1_olderMen.mp3', type:'audio'},
                        {id:_this.id + 'audio2',src: _this.assetBasePath + '/test1/media/roles-1_youngMen.mp3', type:'audio'},
                        {id:_this.id + 'audio3',src: _this.assetBasePath + '/test1/media/roles-2_olderWomen.mp3', type:'audio'},
                        {id:_this.id + 'audio4',src: _this.assetBasePath + '/test1/media/roles-2_youngWomen.mp3', type:'audio'},
                        {id:_this.id + 'image1',src: _this.assetBasePath + '/test1/media/roles.png', type:'image'}];

            var pointsNum = 4,
                pointsArray = [],
                pointColor = '#0040ff';

            var pointsObject = {

                point1:{
                    x:382,
                    y:102},

                point2:{
                    x:146,
                    y:172},

                point3:{
                    x:455,
                    y:102},

                point4:{
                    x:312,
                    y:245},

            };

            var anm = _anm.getNewInstance();

            anm.createSimpleInteraction({parentContainer:_this.element,
                                        queue:queue,
                                        copyright:'2009',
                                        callback:setupClickPoints});

            function setupClickPoints(){

                for(var i = 0; i < pointsNum; i++)
                {
                    var tempNum = i + 1;

                    var clickPointShape = new c.Shape();
                    clickPointShape.graphics.beginFill(pointColor).drawCircle(0,0,16).endFill();

                    var clickPoint = anm.createSimpleButton(clickPointShape, getClickPoint(i));

                    anm.updateContainer(clickPoint,{x:pointsObject['point' + tempNum].x,
                                                    y:pointsObject['point' + tempNum].y,
                                                    alpha:0.01});

                    pointsArray.push(clickPoint);
                }
            }

            function getClickPoint(audioIndex){
                return function(event){
                    anm.playAudio(audioIndex);
                };
            }

        });

    };
}(document));



I just need a different JS code.
Thank you
AnswerRe: S code to have an image with different clickable points that play sound Pin
Kornfeld Eliyahu Peter29-Jun-14 1:50
professionalKornfeld Eliyahu Peter29-Jun-14 1:50 
Questiondevextreme mobile apps call webmethod return only html source code Pin
Member 938843524-Jun-14 16:29
Member 938843524-Jun-14 16:29 
QuestionI am having problem invoking form fields from my js. Any ideas? Pin
samflex24-Jun-14 4:32
samflex24-Jun-14 4:32 
AnswerRe: I am having problem invoking form fields from my js. Any ideas? Pin
Pablo Estrada24-Jun-14 4:57
Pablo Estrada24-Jun-14 4:57 
GeneralRe: I am having problem invoking form fields from my js. Any ideas? Pin
samflex24-Jun-14 5:11
samflex24-Jun-14 5:11 
GeneralRe: I am having problem invoking form fields from my js. Any ideas? Pin
Pablo Estrada30-Jun-14 7:01
Pablo Estrada30-Jun-14 7:01 
Questionproblem to enter to fullscreen mode when playing video using addEventListener Pin
Asaf Shay21-Jun-14 22:25
Asaf Shay21-Jun-14 22:25 
QuestionJavascript code to automatically check the checkbox of duplicate record in gridView Pin
Member 1048440017-Jun-14 20:41
Member 1048440017-Jun-14 20:41 
AnswerRe: Javascript code to automatically check the checkbox of duplicate record in gridView Pin
Raviranjan_Kumar_Sinha18-Jun-14 1:30
Raviranjan_Kumar_Sinha18-Jun-14 1:30 
QuestionJavascript Regex validation Pin
Arunkumar.Koloth9-Jun-14 19:36
Arunkumar.Koloth9-Jun-14 19:36 
AnswerRe: Javascript Regex validation Pin
Kornfeld Eliyahu Peter9-Jun-14 23:14
professionalKornfeld Eliyahu Peter9-Jun-14 23:14 
GeneralRe: Javascript Regex validation Pin
Arunkumar.Koloth9-Jun-14 23:25
Arunkumar.Koloth9-Jun-14 23:25 
AnswerRe: Javascript Regex validation Pin
Kornfeld Eliyahu Peter9-Jun-14 23:42
professionalKornfeld Eliyahu Peter9-Jun-14 23:42 
GeneralRe: Javascript Regex validation Pin
Member 1173096331-May-15 4:55
Member 1173096331-May-15 4:55 
Questionjquery and mootools Pin
Member 94738096-Jun-14 20:10
Member 94738096-Jun-14 20:10 
AnswerRe: jquery and mootools Pin
Kornfeld Eliyahu Peter9-Jun-14 20:25
professionalKornfeld Eliyahu Peter9-Jun-14 20:25 
Questionunable to get property 'childnodes' of undefined or null reference Pin
Member 105519074-Jun-14 5:01
Member 105519074-Jun-14 5:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.