Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Load function in CC

falcon12
Registered User
Quote
2015-12-29 20:43:58

Hello,

I'm trying to use load function (engine.load("somename.ccbjs", true, function(){ alert('is now loaded!')); ) under CC.

Is it possible ? How ?


Regards,


niko
Moderator
Quote
2015-12-30 10:27:21

It works when you are using the CopperLicht SDK. Just replace the copperlicht.js file with the one from the SDK. On its website, you will also find the documentation for that: http://www.ambiera.com/copperlic...


falcon12
Registered User
Quote
2016-01-06 20:57:27

Sorry Niko, I'm not sure I understood.

I did that :

- extracting copperlicht.js form copperlicht SDK 1.10.
- Put (replacing) it in the only place where I could see an other copperlicht.js : The copperlichtData of my CC application.
(I thought CC use a central copperlicht.js file and because
of that it was located in CC's directory, I was wrong. I found
tons of copperlicht.js in each copperlichtdata folders !
There all the same ! So why ?)

--> Nothing change, engine still not recognized.


Please Niko explain me step by step what I must do
for being able to use load function under CC. Or I didn't understood
and you meant it is impossible.

I'm lost.

HELP ! I need somebody's help !!




niko
Moderator
Quote
2016-01-08 07:50:27

You need to be sure that you are really using the right one. Note that CopperCube is overwriting the files (your html and the .js) everytime you publish. So you could for example put them into another directory, or rename them slightly and link them from another file, whatever you prefer.

If you need help with tasks like this, this sounds like you might have not that much experience with programming (just a guess, no offence), so maybe it would be easier for you to use the other solution with multiple .html files instead, this wouldn't need any programming then.


falcon12
Registered User
Quote
2016-01-08 21:45:24

I don't want to use web page switching.

This code, under CC:

engine.load("EssaiLoadSceneVibrionDroiteGauche.ccbjs", true);

Send a "engine" not defined message and don't load anything under html. Ok. I thought startCopperLichtFromFile() function created such a named instance of CopperLicht ("engine") class but I was wrong.

So I tried add "engine" instanciation as global var in the Html :

engine = startCopperLichtFromFile('3darea',.....);

And it works, except that scene's loading
doesn't end because all textures are not found (7/14)
It is strange because I uncheked "wait until textures loaded" in htlm publications parameters of that loaded scene.


If I would have known how I can make reference to the CopperLicht class created by the .exe I thinck I could do the same with exe.

Niko ?


niko
Moderator
Quote
2016-01-10 11:56:16

Will take a look into that, thanks for reporting.


falcon12
Registered User
Quote
2016-01-10 14:53:34

Ok. How can I make reference to engine object with .exe Niko ?

I can't change the .html !

Does engine object is a child of windows object ? Or windows.documents object ?


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact