The site name is now very simple
The site name is changed from pravinranjan.com to pranjan.com.
Its simple to say now pranjan [p r a n j a n].
Tuesday, 16 of March of 2010
About flash
The site name is changed from pravinranjan.com to pranjan.com.
Its simple to say now pranjan [p r a n j a n].
The site name is changed from pravinranjan.com to pranjan.com.
Its simple to say now pranjan [p r a n j a n].
Nearly everyone would feel pains for float datatype in j2me. This article will give you a broad concept to implement or more precisely simulate float in j2me.
First of all, how a float data look like?
78.98, 34.98885, 3.141759 …. and like this.
If you look closer, you will find every float has very small variable unit.
Say 78.98. Its unit is 0.01. Similarly 3.141759. Its unit is 0.000001.
To implement in j2me, we will have smallest unit is 1 and also this is fixed. So what to do?
First of all for every data we will need to pre-assume maximum length. This is so because it will help to choose appropriate type like short, int or long.
int speed = 0;
//Say we need speed similar to 0.5.
Next is enlarge our data as per necessity.
Now,
speed = speed+1;
To get simulated speed of 0.5, we need speed to divide by 2. So the next step will be…
speed = speed / 2;
Actually this will give you 2 consecutive same values like 1,1,2,2,3,3,4,4,….
The same concept will work for larger values.
That’s it for now.
Adobe is going to release next version of Flex with the name of Flash.
Question is where is our old Flash?
Current versions has already lost its legend characteristics of Flash.
I am okay with flex. Good for business based applications. Lots of graphs, easy to use services, components and libraries, rapid development and many revolutionary things. Flash is separate thing to do things differently. Adobe is try to make it dot net kind of environment but I recall this to adobe that people have already things similar to flex but what they do not have is FLASH.
Another problem is Adobe is not keeping its promise to make flash platform independent. I am specifically targeting towards linux. More than a decade and flash or flex is still a dream for linux users.
Therefore, I request Adobe to not to loose legend core of flash.
[The article is not targeting flash environment but that Flash language and IDE]
You can download MathFP jar file from here. For more information visit its parent website http://home.comcast.net/~ohommes/MathFP/
So here we are….
1. Download MathFP for CLDC.
2. Extract MathFP class.
3. Create net/jscience/util directory and then paste your extracted MathFP class file.
4. Right click the net directory and create a zip file. Mac and linux users should take care that archive top folder must be net.
[You can rename the zip file into jar and it will work.]
5. Copy and paste your newely created file to use it. Thats it.
Another way is to create a jar file but also you will need to use points 1, 2 and 3.
Please do write me if you’ll need. Have a nice time.
If you want to export big jpeg images from your AIR based application and hang your computer for a while in exporting. Try to use Derrick Grigg’s new async jpeg encoder. Nice utility class and you’ll certainly love it.
Jack Doyle has launched a new transform manager class that would certainly reduce at least 20% weight from a developer back.
The tool is quite handy and don’t need much attention.
Features are simple and much easier. Boundary constraints, deletion and easy implementation are few great things that can touch you.
Certainly it worth it more than its price.
@Jack, You have done great. Thumbs up.
So don’t wait...just get it from here.
[http://blog.greensock.com/transformmanageras3/]
If you want to grow flash platform and want to link with us, lets exchange website addresses here.
To do this just link this blog URL (http://pravinranjan.com/blog) onto your website and send a simple comment with your website URL to this article. Please also send your web url where you would add this blog’s link. We will check and will add to our website’s link section.
Seems heavy
Many times (I even don’t remember) people ask these questions.
1. My swf works fine in mozilla / firefox but not in internet explorer. Why?
2. When I double click a HTML web page to view my flash content (movie), it shows yellow bar at top. Why?
3. How can we remove yellow information bar in IE (internet explorer) while loading my swf content?
….. and so on.
Well the solution is simple and kiddie to those who knows. But what about who is newbie or less knowledge of flash?
Here is an example, how to write HTML code to embed SWF.
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<title>example</title>
<script language=”javascript”>AC_FL_RunContent = 0;</script>
<script src=”AC_RunActiveContent.js” language=”javascript”></script>
</head>
<body bgcolor=”#000000″>
<script language=”javascript”>
if (AC_FL_RunContent == 0) {
alert(“This page requires AC_RunActiveContent.js.”);
} else {
AC_FL_RunContent(
‘codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′,
‘width’, ‘290′,
‘height’, ‘340′,
’src’, ‘images/SWFs/myswf‘,
‘quality’, ‘high’,
‘pluginspage’, ‘http://www.macromedia.com/go/getflashplayer’,
‘align’, ‘middle’,
‘play’, ‘true’,
‘loop’, ‘true’,
’scale’, ’showall’,
‘wmode’, ‘window’,
‘devicefont’, ‘false’,
‘id’, ‘myswf‘,
‘bgcolor’, ‘#000000′,
‘name’, ‘myswf‘,
‘menu’, ‘false’,
‘allowFullScreen’, ‘false’,
‘allowScriptAccess’,’sameDomain’,
‘movie’, ‘images/SWFs/myswf‘,
’salign’, ”
);
}
</script>
<noscript>
<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0″ width=”290″ height=”340″ id=”t3fla” align=”middle”>
<param name=”allowScriptAccess” value=”sameDomain” />
<param name=”allowFullScreen” value=”false” />
<param name=”movie” value=”images/SWFs/myswf.swf” /><param name=”quality” value=”high” /><param name=”bgcolor” value=”#000000″ /> <embed src=”images/SWFs/myswf.swf” quality=”high” bgcolor=”#000000″ width=”290″ height=”340″ name=”myswf” align=”middle” allowScriptAccess=”sameDomain” allowFullScreen=”false” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” />
</object>
</noscript>
</body>
</html>
Probably this could be your HTML code. {You can use this code for exercise.}
Now, you need ac_runactivecontent to run your javascript. The filename is hilighted in red in above code. This file will reside along with your HTML file.
See in <HEAD>…
<script language=”javascript”>AC_FL_RunContent = 0;</script>
<script src=”AC_RunActiveContent.js” language=”javascript”></script>
These 2 lines add and enable javascript. You need to have the same js file along with the HTML file.
See <BODY>….
<script language=”javascript”>
if (AC_FL_RunContent == 0) {
alert(“This page requires AC_RunActiveContent.js.”);
} else {
AC_FL_RunContent(
‘codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′,
‘width’, ‘290′,
‘height’, ‘340′,
’src’, ‘images/SWFs/myswf‘,
‘quality’, ‘high’,
‘pluginspage’, ‘http://www.macromedia.com/go/getflashplayer’,
‘align’, ‘middle’,
‘play’, ‘true’,
‘loop’, ‘true’,
’scale’, ’showall’,
‘wmode’, ‘window’,
‘devicefont’, ‘false’,
‘id’, ‘myswf‘,
‘bgcolor’, ‘#000000′,
‘name’, ‘myswf‘,
‘menu’, ‘false’,
‘allowFullScreen’, ‘false’,
‘allowScriptAccess’,’sameDomain’,
‘movie’, ‘images/SWFs/myswf‘,
’salign’, ”
);
}
</script>
Now what?
We need your swf that you need to load. Say… your swf name is myswf.swf and it resides in SWFs folder in images folder.
Put images folder along with HTML as shown below.
Copy your swf name with relative path and paste in place of blue colored text as per above example. Keep in mind that you don’t need to write swf extension with its file name. Check carefully.
And you know green colored text script very well so I think I don’t need to elaborate this part.
Double click to open the html to load swf content. If everything fine, your SWF will load perfactly without any security (yellow bar) related problem.
Have a nice day!
Recent Comments