Jump to content

Flash


MsAngel

Recommended Posts

Need Help. appreciate.

 

I got codes to upload image in jpeg file but now i wants to upload

flash in swf file. i need to download library? Can anyone help?

 

this is my codes for jpeg file.

 

image.php

<?php

//header('Content-type: image/jpeg');

header('Content-type: application/x-shockwave-flash');

 

//$im = imagecreatefromjpeg( "Zoo.jpg" );

$im = imagecreatefromjpeg( "map.swf" );

 

$leftLon = 103.7908; $rightLon = 103.7918;

$topX=280; //Longitude = 103.7908

$botX=675; //Longitude = 103.7918

 

$botLat = 1.4030; $topLat = 1.4037;

$botY=700; //Latitude  = 1.4030

$topY=030; //Latitude  = 1.4037

 

global $posLat, $posLon;

$posLat = $_GET['latitude'];

$posLon = $_GET['longitude'];

$posX; $posY;

 

getXY( $posLon, $posLat );

$black = imagecolorallocate($im, 0x00, 0x00, 0x00);

$red  = imagecolorallocate($im, 0xFF, 0x00, 0x00);

$green = imagecolorallocate($im, 0x00, 0x01, 0x00);

 

imagestring($im, 5, $topX, $topY, "X (".$leftLon.",".$topLat.")", $black);

imagestring($im, 5, $botX, $botY, "X (".$rightLon.",".$botLat.")", $red);

imagestring($im, 5, $posX, $posY, "X (".$posLon.",".$posLat.")", $green);

 

imagejpeg($im);

//imagedestroy($im);

 

function getXY()

{

    $arg_list = func_get_args(); //$numargs = func_num_args();

global $leftLon, $rightLon, $botX, $topX, $botLat, $topLat, $topY, $botY, $posX, $posY;

 

$posX = ($arg_list[0]-$leftLon)/($rightLon-$leftLon) * ($botX-$topX) + $topX;

$posY = ($arg_list[1]-$botLat)/($topLat-$botLat) * ($topY-$botY) + $botY;

}

?>

 

test.php

 

<html>

<body>

 

<h4>Enter your lat & lon :</h4>

<?php

$posLat = $_POST["lat"];

$posLon = $_POST["lon"];

 

//echo "" . $posLat . "      " . $posLon . "";

if( $posLat==0 )

$posLat=1.40335;

if( $posLon==0 )

$posLon=103.7913;

?>

 

<form action="test.php" method="post">

 

<?php

print 'Longitude: <input name="lon" type="text" value=' . $posLon . ' />';

print 'Latitude: <input name="lat" type="text" value=' . $posLat . ' />';

?>

 

<input type="submit" />

 

</form>

 

//<?php

//print '<img src="image.php?latitude=' . $posLat . '&longitude=' . $posLon . '">';

//?>

 

 

<?php print '<embed src=image.php?latitude=' . $posLat . '&longitude=' . $posLon . ' quality=high bgcolor=#ffffff name=mymoviename type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer></embed>'

;?>

 

 

</body>

</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.