Jump to content

TweenLite error


Rafus
 Share

Recommended Posts

Hi,

If you import in your html :

<!DOCTYPE html><html><head>    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>    <script src="Lib/Intro.js"></script>    <script src="Lib/pixi/Pixi.js"></script>    <script src="Lib/Phaser.js"></script>    <script src="Lib/utils/Utils.js"></script>     <script src="Lib/pixi/core/Matrix.js"></script>    <script src="Lib/pixi/core/Point.js"></script>    <script src="Lib/pixi/core/Rectangle.js"></script>    <script src="Lib/pixi/display/DisplayObject.js"></script>    <script src="Lib/pixi/display/DisplayObjectContainer.js"></script>    <script src="Lib/pixi/display/Sprite.js"></script>    <script src="Lib/pixi/display/Stage.js"></script>    <script src="Lib/pixi/extras/CustomRenderable.js"></script>    <script src="Lib/pixi/extras/Strip.js"></script>    <script src="Lib/pixi/extras/Rope.js"></script>    <script src="Lib/pixi/extras/TilingSprite.js"></script>    <script src="Lib/pixi/filters/FilterBlock.js"></script>    <script src="Lib/pixi/filters/MaskFilter.js"></script>    <script src="Lib/pixi/primitives/Graphics.js"></script>    <script src="Lib/pixi/renderers/canvas/CanvasGraphics.js"></script>    <script src="Lib/pixi/renderers/canvas/CanvasRenderer.js"></script>    <script src="Lib/pixi/renderers/webgl/WebGLBatch.js"></script>    <script src="Lib/pixi/renderers/webgl/WebGLGraphics.js"></script>    <script src="Lib/pixi/renderers/webgl/WebGLRenderer.js"></script>    <script src="Lib/pixi/renderers/webgl/WebGLRenderGroup.js"></script>    <script src="Lib/pixi/renderers/webgl/WebGLShaders.js"></script>    <script src="Lib/pixi/text/BitmapText.js"></script>    <script src="Lib/pixi/text/Text.js"></script>    <script src="Lib/pixi/textures/BaseTexture.js"></script>    <script src="Lib/pixi/textures/Texture.js"></script>    <script src="Lib/pixi/textures/RenderTexture.js"></script>    <script src="Lib/pixi/utils/EventTarget.js"></script>    <script src="Lib/pixi/utils/Polyk.js"></script>    <script src="Lib/core/Camera.js"></script>    <script src="Lib/core/State.js"></script>    <script src="Lib/core/StateManager.js"></script>    <script src="Lib/core/LinkedList.js"></script>    <script src="Lib/core/Signal.js"></script>    <script src="Lib/core/SignalBinding.js"></script>    <script src="Lib/core/Plugin.js"></script>    <script src="Lib/core/PluginManager.js"></script>    <script src="Lib/core/Stage.js"></script>    <script src="Lib/core/Group.js"></script>    <script src="Lib/core/World.js"></script>    <script src="Lib/core/Game.js"></script>    <script src="Lib/input/Input.js"></script>    <script src="Lib/input/Keyboard.js"></script>    <script src="Lib/input/Mouse.js"></script>    <script src="Lib/input/MSPointer.js"></script>    <script src="Lib/input/Pointer.js"></script>    <script src="Lib/input/Touch.js"></script>    <script src="Lib/input/InputHandler.js"></script>    <script src="Lib/gameobjects/Events.js"></script>    <script src="Lib/gameobjects/GameObjectFactory.js"></script>    <script src="Lib/gameobjects/Sprite.js"></script>    <script src="Lib/gameobjects/TileSprite.js"></script>    <script src="Lib/gameobjects/Text.js"></script>    <script src="Lib/gameobjects/BitmapText.js"></script>    <script src="Lib/gameobjects/Button.js"></script>    <script src="Lib/gameobjects/Graphics.js"></script>    <script src="Lib/gameobjects/RenderTexture.js"></script>    <script src="Lib/system/Canvas.js"></script>    <script src="Lib/system/StageScaleMode.js"></script>    <script src="Lib/system/Device.js"></script>    <script src="Lib/system/RequestAnimationFrame.js"></script>    <script src="Lib/math/RandomDataGenerator.js"></script>    <script src="Lib/math/Math.js"></script>    <script src="Lib/math/QuadTree.js"></script>    <script src="Lib/geom/Circle.js"></script>    <script src="Lib/geom/Point.js"></script>    <script src="Lib/geom/Rectangle.js"></script>    <script src="Lib/net/Net.js"></script>    <script src="Lib/tween/TweenManager.js"></script>    <script src="Lib/tween/Tween.js"></script>    <script src="Lib/tween/Easing.js"></script>    <script src="Lib/time/Time.js"></script>    <script src="Lib/animation/AnimationManager.js"></script>    <script src="Lib/animation/Animation.js"></script>    <script src="Lib/animation/Frame.js"></script>    <script src="Lib/animation/FrameData.js"></script>    <script src="Lib/animation/Parser.js"></script>    <script src="Lib/loader/Cache.js"></script>    <script src="Lib/loader/Loader.js"></script>    <script src="Lib/loader/Parser.js"></script>    <script src="Lib/sound/Sound.js"></script>    <script src="Lib/sound/SoundManager.js"></script>    <script src="Lib/utils/Debug.js"></script>    <script src="Lib/utils/Color.js"></script>    <script src="Lib/physics/arcade/ArcadePhysics.js"></script>    <script src="Lib/physics/arcade/Body.js"></script>    <script src="Lib/particles/Particles.js"></script>    <script src="Lib/particles/arcade/ArcadeParticles.js"></script>    <script src="Lib/particles/arcade/Emitter.js"></script>    <script src="Lib/tilemap/Tilemap.js"></script>    <script src="Lib/tilemap/TilemapLayer.js"></script>    <script src="Lib/tilemap/Tile.js"></script>    <script src="Lib/tilemap/TilemapRenderer.js"></script>    <script src="com/app/Const.js"></script>    <script src="com/app/Main.js"></script>    <script src="com/app/GuessTitleLevel.js"></script>    <script src="com/app/DataHandler.js"></script>    <script src="greensock/CSSPlugin.min.js"></script>    <script src="greensock/EasePack.min.js"></script>    <script src="greensock/TweenLite.min.js"></script>    <link href="css/style.css" rel="stylesheet">    <link href="css/fonts.css" rel="stylesheet">    <meta charset="UTF-8"></head><body>    <div id="top">        <a onclick="window.close()" id="x"></a>        <a onclick="window.history.back()" id="home"></a>    </div>    <div id="content">        <h1>Navigare necesse est</h1>    </div>    <script type="text/javascript">        function boot()        {            var game = new Phaser.Game(1024, 700, Phaser.AUTO, "content");            game.state.add('boot', Main.Boot,true);            game.state.add('preloader', Main.Preloader);            game.state.add('guessTitleLevel', GuessTitleLevel.Game);                    }        window.onload = function () {            boot();        }    </script>    ></body></html>

you will get this error when you open it in fire fox.

Error that i recived says: "TypeError: Number is not a function" in tweenlite, but if i try tu use Tweenlite without phaser then it works.

Link to comment
Share on other sites

The game I'm making it will be put on cd and played offline in chromium.

 

The engine needs web server to work.

 

http://phaser.io/getting-started-js.php

 

As obvious as this may sound, when you make HTML5 games you are making games for a web browser, and as such you have to work within the security restrictions of those browsers. One such restriction is that a browser cannot access your local file system by default. This is a good thing! After all, think of the potential repurcusions if it could.

 

But what it means is that you can't just drag a Phaser HTML file onto your browser and expect it to run. The file will need to be served from a web server if you want it to be able to load in resources like images or music. But that server can easily run locally and that's how we develop all of our games here.

 

 

You can't distribute HTML5 game to be played on CD.. at least not with phaser... and maybe if your game use only visual elements generated and drawn with code...

Link to comment
Share on other sites

Just to say that TweenLite/Max works fine with Phaser 1.1. I inserted the lib into the html and made a simple test case and it runs fine:

var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });function preload() {    game.load.image('ball', 'assets/sprites/yellow_ball.png');}var ball;function create() {    ball = game.add.sprite(300, 0, 'ball');    TweenLite.to(ball, 10, { y: 400 });    }
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...