Archive

Posts Tagged ‘flash’

Using swfObject with Mootools

August 4th, 2009 11 comments

I'm sure most of us use swfObject, which in my opinion is the best option when it comes to embedding flash.

Lately I've been having a lot of fun with mootools and needed a way to embed flash dynamically. Basically I wanted my flash file to be embedded after a mootools click event was triggered.

So without further ado..

  1. window.addEvent('domready', function() {
  2.  
  3. //get the div I want to embed my flash into.
  4. var flashcontainer = $('flashcontainer');
  5.  
  6. //set all the flash properties
  7. var file = 'file.swf';
  8. var moviename = 'nameMyFlash';
  9. var width = '640';
  10. var height = '424';
  11. var version = '9';
  12. var bgcolor = '#000000';
  13.  
  14. //create the function that will fuse swfObject with mootools
  15. var embedFlash = function(){
  16. var so = new SWFObject(file, moviename, width, height, version, bgcolor);
  17. so.addParam("quality", "high");
  18. so.addParam("align", "middle");
  19. so.addParam("play", "true");
  20. so.addParam("loop", "true");
  21. so.addParam("scale", "exactfit");
  22. so.addParam("allowFullScreen", "true");
  23. so.addVariable("variable1", "variable 1 value goes here");
  24. so.addVariable("variable2", "variable 1 value goes here");
  25. so.write(flashcontainer);
  26. }
  27.  
  28. //get button by id
  29. var myButton = $('mybutton');
  30.  
  31. // create click event to fire my function called "embedFlash()"
  32. myButton.addEvent('click', embedFlash);
  33.  
  34. });

And that's it.. Hope it helps....

You can download the latest tools used above from the links below:
MooTools - download release 1.2.3 or SWFObject 2.2

Your slots payouts will be out of proportion from the progressive slots when you hit the slots bonus using the slots secrets of CasinoBonus.org!

Adobe Announce Flash 10 For Android

February 16th, 2009 No comments

Adobe have announced that Flash 10 will be making it's way to the Android platform by the end of the year. In an announced at the Mobile World Congress event in Barcelona, Adobe revealed that they plan to release their first full-fledged Flash multimedia player for smartphones by the end of 2009.

"We've made a lot of progress, but there is still a lot of engineering work to be done," said Anup Murarka, director of partner development and technology strategy for Adobe's platform business unit.

Adobe are expected to demonstrate the Flash Player 10 for smartphones beta during the Mobile World Congress event.

Categories: News Tags: , , ,

Disable all buttons in flash or disable 1 button in flash

February 3rd, 2009 3 comments

Recently I needed to disable all buttons on my flash site. I trawled the net looking for answers but all I got was what I already knew. Which is disabling each button 1 by 1 using an array like so:

  1.  
  2. //an array of button instance names
  3. var buttonInstanceNames:Array = new Array("button1","button2",
  4. "button3", "button4");
  5.  
  6. //function that sets the buttons enabled state
  7. function enableButtons(e){
  8. for(var i=0;i<buttons.length;i++){>
  9. this[buttonInstanceNames[i]].enabled = e;
  10. }
  11. }
  12.  
  13. //call function and assign enabled state
  14. enableButtons(false);

This is all good if you have a few buttons but what if your site is complex like the 1 I was working on and you wanted to disable all button interactivity without knowing buttons instance names.

Solution
Basically place a movie clip button over the entire movie or just over the area where your buttons are with _alpha set to 0. Remember to set the movie clip with a onRollOver, or onRelease event. Just set the blocking movie clip's _visible state to false when you want interactivity back.

Here is the code I used to get this working.

  1.  
  2. //The instance name of my blocker movieclip is "mcBlocker"
  3. //show or hide the button blocker
  4. function enableButtons(e){
  5. mcBlocker._visible = e;
  6.   mcBlocker.onRollOver = doNothing;
  7.  }
  8.  
  9. //do nothing when the blocker active
  10. function doNothing(){}
  11.  
  12. //just enable or disable the blocker
  13. enableButtons(false);
  14.  

Hope this helps..

Papervision3D

February 14th, 2008 No comments

Papervision3D is an open source 3D engine for Flash. Its fairly new but it has allowed flash developers to produce some amazing work. More information on Papervision3D can be found @ http://blog.papervision3d.org/.

Below are some of my favorite sites that make use of Papervision3D.

SEO Powered by Platinum SEO from Techblissonline