«

January 2009

»
ti on to fr
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Foreach magic

I just figured out a way to affect an array which you are currently iterating through. We just make use of pointers (like old c++ style). Notice the &$currArr (at line 9), that means that we are pointing the currArr to the same place as the real array, that makes it possible to make changes in realtime (while looping through the same array). In theory I thought that this would fuckup my loop. But it worked like a charm. =)


1
2 <?php
3         $arr = array(=> array("ID"=>"45"), => array("ID"=>"46"), => array("ID"=>"666""AnotherInsideID" => 48), => array("ID"=>"666"), => array("ID"=>"666"), => array("ID"=>"4558"));
4         
5         print_r($arr);
6         
7         echo "<br />";
8         $cnt 0;
9         foreach($arr as &$currArr) {
10                 //$filterNr = 666;
11                 if($currArr["ID"]==666) {
12                     $filterNr $currArr["ID"];
13                     echo $cnt " - " $currArr["ID"] . "<br />";
14                     $arr FilterFileDataIDs($arr$filterNr);
15                 }
16                 
17                 print_r($arr);
18                 
19                 echo "<br /><br />";
20                 $cnt++;
21         }
22         
23         print_r($arr);
24                 
25         function FilterFileDataIDs($i_arr$i_number) {
26             foreach($i_arr as $key => $value) {
27                 if($value["ID"]==$i_number) {
28                     unset($i_arr[$key]);
29                 }
30             }
31             
32             return $i_arr;
33         }
34         
35     
36 ?>
37
38



Integrate your flashweb with Google Analytics

I've just realised I need to add some more ways to register user activities on my flash websites.
A good place to start if you want to learn how to register flash activities with google analytics: here



Fixed the comment system

I've just fixed an issue with the comment system of this blogg, and it should now work properly.
Give it a try, thanks! =)



Flash vs. ajax

I just found some cool sliders which are made in flash, which in turn communicates (via ajax) with your webpage.
Please take a look at the cool slider, and find out more how it works.

I will implement this kind of communication in my next projects for Avtre.

slider

Another tip for all of you who need a quick thumbnail gallery in javascript.

gallery



TinyMCE and AJAX

Well, as usual when blending different libraries we run into trouble...at least I did.
It's when you have updatePanels, pages flipped with Ajax...loading info in and out...
When using TinyMce on textareas I sometimes get an error while using the code: "tinyMCE.saveTrigger(false, true);" which must be used before a postback. So that the textarea returns into normal state and we can get the info out of it....
The error looks like "t.win.document has no properties"

Annoying...isn't it!?¿

Though thanks to google, I found a some different solutions.
The solution for me was to make sure that each TinyMCE panel gets setup correctly, and deleted BEFORE a pageflip occur. We can do that with an array in our major javascript file to keep track of which MCE elements we have active.

1
2 //  [ Javascript ]
3
4 var activeEditors = new Array()
5
6 function activateEditor(id) {
7     activeEditors[activeEditors.length] = id;
8     toggleEditor(id);
9 }
10
11 function deactivateEditors() {
12     for(x=0;x<activeEditors.length;x++) {
13         toggleEditor(activeEditors[x]);
14     }
15     activeEditors.length 0;
16 }
17
18 // functions
19 function toggleEditor(id) {
20     var elm document.getElementById(id);
21
22     if (tinyMCE.getInstanceById(id) == null)
23         tinyMCE.execCommand('mceAddControl'falseid);
24     else
25         tinyMCE.execCommand('mceRemoveControl'falseid);
26 }
27
28 //  [ End Of Javascript ]
29
30



Blogg updates

I made some updates to the code of my blogg.

* Fixed dynamic categories
* Fixed editing of "about" and "contact" page.
* Fixed images for "about" and "contact" page, also small pics for categories (if needed)

That's about it...now it has all the standard features.

I'm going to upload some photos from my trip to LA and E3 expo 2004 this weekend.
Enjoy!



Major updates

Phew, just finished a major update on one of the current programming projects. And aside from that I've manage to pull of a few songs while going through some of the new sounds/samples in the Kontakt 3 and Symphonic Orchestra libraries.

The quality is just extremely perfected.
I hope to be able to include the mp3 player from www.morningdewmedia.com on this page soon, so you can access and listen to some of the new songs that I produce.



Online again

Phew...after some major workload I've manage to update this blogg so that it works with the old PHP 4 engine on my loopia account.

So, what's happened lately...well I bought a electronic drumkit from Hart Dynamics. Which is very cool and has all kinds of great features like rim-shots and dual bassdrum recognition. I will run it through my software sampler Kontakt 3 and with my custom sampled Pearl Master drumkit. =)

I also tried it out with some Jazz kits through Stormdrum and it sounded really amazing.

Except some new music and art samples shortly.

Me and my girlfriend have moved to a house in Skellefteå, which is 108 square meters. And I've just setup the studio equipment in place.

During december I delivered a music theme batch to Ice Concept Studios and their upcoming XBOX 360 / PC title called LEGIO.



Webserver crash

My webserver died last week, so I have to rewrite all the entries and upload all pictures again to this new blogg.
A mp3 player will also be added to this page shortly.
Until then you can listen to my music over at www.morningdewmedia.com