Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Convert Image Map Data To Actionscript


I have a website that has a gallery full of hotspotted images. I would like to convert the gallery to Flash. However, I do not wish to "re-hotspot" all the images. Is there a way to convert the hotspot coordinates into Actionscript and receive an equivalent shape and assign actions to it.

<map name="Map">
<area shape="poly" coords="62,104,32,29,97,67,170,32,145,99,166,133,7 7,169,20,163" href="#">
</map>

Any help would be greatly appreciated.




FlashKit > Flash Help > Flash ActionScript
Posted on: 04-13-2005, 12:10 PM


View Complete Forum Thread with Replies

Sponsored Links:

Convert A MC To Image Using Binary Data
How can I change this so it saves the image as binary data. This code works fine but when the image is created the file size is too big.PLEASE HELP!!


Code:
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.ColorTransform;
import flash.geom.Matrix;

/**
* Little and simple print flash screen class
*/
class PrintScreen {

public var addListener:Function;
public var broadcastMessage:Function;

private var id:Number;
public var record:LoadVars;

function PrintScreen () {
AsBroadcaster.initialize (this);
}
public function print (mc:MovieClip, x:Number, y:Number, w:Number, h:Number) {
broadcastMessage ("onStart",mc);
if (x == undefined) {
x = 0;
}
if (y == undefined) {
y = 0;
}
if (w == undefined) {
w = mc._width;
}
if (h == undefined) {
h = mc._height;
}
var bmp:BitmapData = new BitmapData (w, h, false);
record = new LoadVars ();
record.width = w;
record.height = h;
record.cols = 0;
record.rows = 0;
var matrix = new Matrix ();
matrix.translate (-x,-y);
bmp.draw (mc,matrix,new ColorTransform (),1,new Rectangle (0, 0, w, h));
id = setInterval (copysource, 2, this, mc, bmp);
}

private function copysource (scope, movie, bit) {
var pixel:Number;
var str_pixel:String;
scope.record["px" + scope.record.rows] = new Array ();
for (var a = 0; a < bit.width; a++) {
pixel = bit.getPixels (a, scope.record.rows);
str_pixel = pixel.toString (16);
if (pixel == 0xFFFFFF) {
str_pixel = "";
}
// don't send blank pixel
scope.record["px" + scope.record.rows].push (str_pixel);
}
scope.broadcastMessage ("onProgress",movie,scope.record.rows,bit.height);// send back the progress status
scope.record.rows += 1;
if (scope.record.rows >= bit.height) {
clearInterval (scope.id);
scope.broadcastMessage ("onComplete",movie,scope.record);// completed!
bit.dispose ();
}
}
}

View Replies !    View Related
Convert JPEG Image Into A Binary Data
Is it possible to convert an JPEG image to binary data. Because if this would be possible
then you can insert this data in a database.

Regards,

Micehal.

View Replies !    View Related
Create Image With Actionscript From Jpeg Data?
Hi,

I have a program that returns raw jpeg data. Normally this data is sent to a server and there it is interpreted to show a jpeg.
But i would now like to display that jpeg in flash, using actionscript.
Does anybody know if there is a way to do this?

thanks!

View Replies !    View Related
Must-read: How To Batch Convert Image Files To Swf (for Image Galleries)
Sorry for cross-posting, but I thought this was important.

If you ever need to create an image gallery in Flash using loadMovie(), read this:

Last night, I was trying to create a Flash image gallery where each of the images are loaded dynamically using loadMovie(). As you know, this is usually a very painful process, since you have to create a movie for each of the image files, adjust the size of the movie, import the picture, set the quality, test, adjust, etc. etc. A conservative estimate of 5 minutes per picture gives us a whopping 2 hours for a gallery of 25 images.

Well, Fireworks 4 allows you to export to swf. Using its javascript API for extending, I was able to create a command where you specify the files to convert, the output dir, and the JPEG quality for bitmaps, and with that info the command batch converts all of the files to swf. The total process takes about 30 seconds!

Here's how you can use it:

Copy everything between these lines (not including the lines) and paste it into an empty NotePad:


Code:
//Batch export to swf; a script for Fireworks 4
//By Patrick Mineault
//patrickmineault@sympatico.ca

function checkForPC(){
if(fw.platform == "win"){
return true;
}
else{
alert("Sorry, this script works only with Fireworks 4 for Windows

" +

"If you would like to help me make the script compatible for the Mac,
" +
"please contact me at patrickmineault@sympatico.ca");

return false;
}
}

function noWindowsOpen(){
if(fw.documents.length == 0){
return true;
}
else{
alert("Please close all documents
before running this script");
return false;
}
}

function getDocs(){
alert("Select the image files
to batch convert to swf");
theDocList = fw.locateDocDialog(50, ["kMoaCfFormat_BMP",
"kMoaCfFormat_GIF",
"kMoaCfFormat_JPEG",
"kMoaCfFormat_PICT",
"kMoaCfFormat_TIFF",
"PNG"
]);

if (theDocList == null || theDocList.length == 0) {
return false;
}else {
return true;
}
}

function getExportPath(){

alert("Please choose an export folder");
thePath = fw.browseForFolderURL();
if (thePath == null || thePath.length == 0) {
return false;
}
else{
return true;
}
}

function getJPEGQuality(){

fw.dismissBatchDialogWhenDone = true;
var notFinished = true;
var result;

while(notFinished){
JPEGQuality = prompt("Non-vector objects will be converted
" +
"to JPEG's during the export process.

" +

"Please enter the JPEG quality.","75");

if(JPEGQuality == null){
notFinished = false;
result = false;
}
else if(!(JPEGQuality >= 0 &&
JPEGQuality <= 100 &&
JPEGQuality == Math.round(JPEGQuality))){
alert("Please enter a valid value");
}
else{
notFinished = false;
result = true;
}
}
return result;
}

function batchProcess(){

fw.batchStatusString = "Exporting as swf... please wait";
fw.progressCountTotal = theDocList.length;

fw.setPref("SwfMaintainObjEditable", true);
fw.setPref("SwfMaintainTextEditable", false);

var numOpenDocs = fw.documents.length;

for (var i = 0; i < theDocList.length; i++) {

fw.progressCountCurrent = i + 1;
var theDoc = theDocList[ i ];

theDocWindow = fw.openDocument(theDoc, false);
fw.setActiveWindow(theDocWindow);
convertToSWF(theDoc);
theDocWindow.close(false);
}
alert("Done!");
}

function convertToSWF(theDoc){

var lastSlash = theDoc.lastIndexOf("/");
//This part won't work on the Mac, since there is no last dot
var lastDot = theDoc.lastIndexOf(".");
var name = theDoc.substring(lastSlash+1,lastDot);
var url = thePath + "/" + name + ".swf";

fw.setPref("SwfJpegQuality", JPEGQuality);
fw.exportSWF(null,url);

}

if(checkForPC()){
if(noWindowsOpen()){
if(getDocs()){
if(getExportPath()){
if(getJPEGQuality()){
batchProcess();
}
}
}
}
}


Save this as "Batch export as swf.jsf" in C:Program FilesMacromediaFireworks 4ConfigurationCommands. The next time you open Fireworks, you'll see a new item in the Command menu, "Batch export as swf". Just run it and follow the instructions.

The script works with gifs, jpegs, bmp, tiff, pict and Fireworks PNG. Note that for Fireworks PNG the paths are exported as vectors, not as bitmaps. I've only tested the script on Windows, it probably won't work for the Mac; luckily there's an if that checks for the platform.

Anyway, enjoy!

Note: If you can fix the incompatibility with the Mac (look at the comment in the convertToSWF() function), please either e-mail me at patrickmineault@sypatico.ca, or post a meesage below.
[Edited by pmineault on 06-17-2001 at 07:35 PM]

View Replies !    View Related
Convert Xml Data To Number Variable :(
This is really doing my head in?
Could someone please let me know what I am missing.

scenario:
loading xml into flash...all good

retrieve a number from xml...all good
_root.number=my_xml.firstChild.childNodes[0].firstChild

display number we have retrieved...all good
trace(_root.number)//returns 3

add 2 to this number...all goes pear shaped
_root.number+=2
trace(_root.number)//returns "NaN"

I guess I have to convert the parsed xml value somehow but unable to find out how.

Any help greatly appreciated.
Kind thanks
Cylon

View Replies !    View Related
Convert Net.socket Data To String
Hi,

I have a ProgressEvent.SOCKET_DATA listener on my socket object and I am
trying to convert a tutorial to recieve joystick data from a C# project.
I want it to recieve data from a VB6 winsock control. I would prefer
string data here. I though readMultiByte would be the right function but
it doesn't work so well.

Maybe the data send from winsock control istn't the right way or maybe I
am using readMultiByte the wrong way. The application also slows down.
Or shouldn't I use net.Socket because it is more for binary data?

Any ideas?

TIA

View Replies !    View Related
How To Convert Movieclip Data's Into Pdf File In Flash AS3.0?
Hi everyone,

How to convert movieclip data's into pdf file in flash AS3.0? Using save button i want to generate pdf file. Is it possible in AS3.0?

View Replies !    View Related
How To Convert ByteArray Data Into String And To Store Into A File On HD
Dear All,

I have a problem, please can any body solve it on urgnet bases.
I am reading data from Socket (in Adobe AIR using action script 3.0), then need to convert it into String. After some manipuations on string i want to save that data on HD. The problem is when i get read data from socket via readbytes in a byte array after converting it into string, for some parsing. When i re convert data into bytearray and save it then , some data is lost. I'm dead stuck in it. Please help me! Thanks in Advance.

View Replies !    View Related
Unable To Convert XML String To Number Data Type
Hi all;
I wonder if someone has seen this problem. I am reading a number of text values from an XML file, including one which I would like to identify as the point value (it's a multiple choice game). When I read the childnode value, it is recognized okay in Flash;

ActionScript Code:
pointValue = xmlData.firstChild.firstChild.childNodes[nextCount].childNodes[1].firstChild.nodeValue;
trace window indicates "100" for pointValue (but this is a text string)

When I try to convert the data type to a number;

ActionScript Code:
pointValue:Number = Number(xmlData.firstChild.firstChild.childNodes[nextCount].childNodes[1].firstChild.nodeValue);
This statement (above) gives syntax errors.

If I try something like this;

ActionScript Code:
pointValue = xmlData.firstChild.firstChild.childNodes[nextCount].childNodes[1].firstChild.nodeValue;
pointValue_n = Number(pointValue);
trace window indicates "100" for pointValue
trace window indicates "NaN" for pointValue_n

This seems like it should be an easy step, but I can't figure out why it won't work??
Thanks in advance for any help.
- jim

View Replies !    View Related
How To Convert Input Text To: String And Array For Manipulating Stored Data?
Hi!

So, here's my problem:
I've got input text: *text1* consisting of several letters.
How do I "split up" that input text, so that I receive every letter seperatly?

I was thinking of something like:
string>substring>array

Anybody?
Thank you all in advance!

View Replies !    View Related
Convert SWF To Image
Hello All,

I'm working on somewhat of a templated system
where I've got a SWF file as a template and then
people upload their own images and place them in
the certain masked areas of the SWF to create
like a scrapbook page.

My question is this, what would be the best way
to convert those images to an image that people
can save and thus print? Would I have to do this
while their viewing the SWF or is there a way to
generate an image with some sort of command line
tool that I'd pass the swf the user's settings to make
the SWF unique each time?

Let me know what'd be best.

Thanks,

-- DC

View Replies !    View Related
Convert Actionscript Flash 5 To Actionscript 2.0
any one can tell me how to convert actionscript flash 5 to actionscript 2.0??? anythings i need to take note? i reallynew in actionscript 2.0...please help me.. thanks a lot

View Replies !    View Related
Copying Loaded Image Bitmap Data To Another Image Loader
Hi,

I have an app where the user uploads an image into an image loader component. I am trying to figure out how to copy the bitmap data from that loaded image into another image loader component.

Could someone steer me in the right direction? I was looking at bitmap clone and copypixels though haven't figured out how to get this to work yet.

Thanks,

Dan

View Replies !    View Related
Convert Image To Vector?
Hi folks, complete flash idiot here... Can someone tell me if there is a way to take a jpg or gif and convert it to a vector graphic? I want to be able to use it in a swish project... Possible? Thanks very much!

View Replies !    View Related
Convert Image Format
I need to display images inside a Ruby on Rails project as flash or swf. anyone have any ideas on how this would be done?

I upload images, resize them with mini-magick ( a ruby wrapper for imagemagick) and then place them in the filesystem. I would then like for when they are displayed inside of html to be displayed as swf to prevent people from downloading the files.

Thanks in advance for any ideas.





























Edited: 06/06/2007 at 02:26:02 PM by m34joey

View Replies !    View Related
How To Convert A Drawing From SWF To Image/PDF
Hi All,
I need a help in AS 3.0. The requirement is, user needs to draw something and take a screenshot or in the PDF format from flash swf by clicking a Save button[Save button will be in the same flash file]. Is it possible in AS 3.0 with out any plug-ins?

Thanks,
Guru.

View Replies !    View Related
How Do We Convert Image Into A Shape
Hi,

When we convert a design from photoshop to flash ie animated it we import a particular image as png or jpg format and then animated it and all.

But i have just been through some fla files where the image is in the form of shape. We can change the shape of the image by the curve or strech the corners by the corner angle that we get. Here the image doesn't get destracted by the bg do gets streched or curves as we want. I wanted to know how do we convert an image to a shape in flash.

Attacehd is an image for what i'm trying to know

rgds
bn

View Replies !    View Related
How Do We Convert Image Into A Shape
Hi,

When we convert a design from photoshop to flash ie animated it we import a particular image as png or jpg format and then animated it and all.

But i have just been through some fla files where the image is in the form of shape. We can change the shape of the image by the curve or strech the corners by the corner angle that we get. Here the image doesn't get destracted by the bg do gets streched or curves as we want. I wanted to know how do we convert an image to a shape in flash.

Attacehd is an image for what i'm trying to know

rgds
bn

View Replies !    View Related
Convert Image Sequance To FLV
Greetings,

I need to convert a large image sequence (Approx. 2000 frames) to and FLV file. Is this possible from Flash 8 without any third party tools?

-Edward

View Replies !    View Related
Convert Actionscript 6 To 8
Hi all, im using the script:


Code:
speed = 30
elas = 1.3

function slide() {
this.dx = this.tx - this._xscale
this.tempx = this.tempx/elas + this.dx/speed
this._xscale += this.tempx

}

mc.tx = 100
mc.onEnterFrame = slide


But need to convert it or find the equivelent for flash 8. Can anyone tell me how to go about this?

View Replies !    View Related
Convert C++ To Actionscript..possible?
Hi all, I am doing my final year project on educational software on cams. I was wondering if it is possible to convert c++ to actionscript as the 2nd part of my software requires user inputs. Example: I have choices A,B,C,D,E,F,G,H,I,J & K. User chooses A,C,E,G,I & K.When he press enter, his choices would result in (I).

If it is possible, how do I go abt starting?I would like to try on my own til I give up..=)

Any help would be so greatly appreciated..Cheers!!

View Replies !    View Related
[F8] Convert Actionscript 1.0 To 2.0
This following script works in 1 but not in Actionscript 2:


Code:
scale = Number(random(50))+30;
setProperty(_target, _x, Number(../:x)+Number(random(12))-6);
setProperty(_target, _yscale, scale);


It says "Unexpected '.' encountered." :/

I found the attached fla on this website, I love it and it works great, but not in Actionscript 2.0. Can someone help me make it work in A. 2.0?

View Replies !    View Related
Convert Actionscript 2.0 To 3.0
Hi,

I've found the following code to generate snowflakes.
however it is from actionscript 2.0.

How can i convert it to actionscript 3.0 ?
i mean that when i test this under actionscript 3.0, flash cs3 tells me
for example 1120: Access of undefined property amount.
and this points to amount = 100.

thanks a lot.

----
amount = 100;
mWidth = Stage.width;
mHeight = Stage.height;
for (var i = 0; i<amount; i++) {
thisFlake = this.attachMovie("flake", "flake"+i, i);
with (thisFlake) {
_x = Math.random()*mWidth;
_y = Math.random()*mHeight;
_xscale = _yscale=_alpha=40+Math.random()*60;
}
thisFlake.yspeed = Math.random()*2+.2;
thisFlake.increment = -0.025+Math.random()*0.05;
thisFlake.radian = 0; //declare for actionscript 2.0
thisFlake.onEnterFrame = function() {
this.radians += this.increment;
//trace(this.radians);
this._x += Math.sin(this.radians);
this._y += this.yspeed;
if (this._y>=mHeight) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
if (this._x>=mWidth || this._x<=0) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
};
}

View Replies !    View Related
AS2 - Need To Convert Some Actionscript From Swf V6 AS2 To V8 AS2
Hi.

I need to upgrade some code from swf v6 AS2 to v8 AS2.

For example this is the v6 as2 code:
if (((_local2 == null) || (_local2 == undefined)) || (_local2 == "")) {

It would need upgrading to:
Fixing this (with quots around undefined), like,
if (((_local2 == null) || (_local2 == "undefined")) || (_local2 == "")) {

Can anyone tell me other stuff that I need to look out for?

Matt

View Replies !    View Related
Convert Image(bmp,jpg,gif) To Flash Graphics
Hi All !

All I need is a program that can converts famouse image file formats such as jpg, bmp or gif to actual Flash Graphics that we are using inside Flash. If anybody know any comercial once or anything please help.

Thx.

View Replies !    View Related
Convert A Flash Mx2004 To A Still Image
I need to capture a flash 2004mx image on a website and convert it to
a still image, jpg, gif.
How do I go about doing this and do I need any special program?
I am not using any flash programs and just need a still imge captured.
Thanks!
F

View Replies !    View Related
Convert Canvas To Background Image
Hello, I'm working on a small drawing app.. all is working well for drawing simple shapes. I have a pen tool that simply draws small line segments while the user holds the mouse down and draws. After a while the app really slows down because I have ton's of layers. I really don't need to be moving these shapes around.. so there's a lot of overhead in the layering.

Is there a way to capture all the pixels on the screen, erase all the shapes, then drop down the captured image as a background image. I figure every 100 shapes or so I could do this (if it's a slow process to do).

I found some classes that would probably do it.. but still a bit baffled on how to capture my canvas into an image.

This example I found in the docs seems almost there..


Code:
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;

var bmd1:BitmapData = new BitmapData(80, 80);
var bmd2:BitmapData = new BitmapData(80, 80);

var seed:int = int(Math.random() * int.MAX_VALUE);
bmd1.noise(seed, 0, 0xFF, BitmapDataChannel.RED, false);
bmd2.noise(seed, 0, 0xFF, BitmapDataChannel.RED, true);

var bm1:Bitmap = new Bitmap(bmd1);
this.addChild(bm1);
var bm2:Bitmap = new Bitmap(bmd2);
this.addChild(bm2);
bm2.x = 90;
Of course this is just putting random noise in the BitmapData, I'd like to capture the current screen and put it in there. Any help would be appreciated

thnx

Daniel

View Replies !    View Related
How To Convert Movieclip Into Image At Runtime?
hi to all
i am using AS3 and i have developed an application in which i have 5 images in library and all of them are converted into symbol (buttons) and linked for action script as class.
what i am doing is when i click an image (one of these five ) on stage then i create a new instance of that images class and display that into another area which is unfilled rectangle (which is converted into movieclip).
there are also two text boxes and the text on these boxes appears on the new instance of image in rectangle. upto this there is no problem.

i have a upload btn i want that when i click that btn then the new created image and text upon that image can upload to desired directory as image file.
can it possible to convert these three (rectangle, image and label on image)
how can i do that?

bundle of thanks in advance

View Replies !    View Related
Convert An Image To A Button Dynamically
How to convert an image to a button through actionscript 2 (flash mx 2004)? Is it necessary to convert it to a button or there is an event so that if someone clicks on an image, he will go to another frame. I load images into my flash through an xml file and i need an event so than if someone clicks on an image, he will go to another frame.
Thanks.

View Replies !    View Related
Convert An Image To Button Dynamically
How to convert an image to a button through actionscript 2 (flash mx 2004)? Is it necessary to convert it to a button or there is an event so that if someone clicks on an image, he will go to another frame. I load images into my flash through an xml file and i need an event so than if someone clicks on an image, he will go to another frame.

View Replies !    View Related
Convert Image To Numbers (ALIASES)
Hello all,
i want to check if someone know how to convert image to aliases ?
any software can do that ?
you can check the demo made by Robert Penner, any one can tell me how did he convert his images ?

source code : http://www.souwar.com/Mosaic.zip

Thanks

View Replies !    View Related
How Do I Convert This Code To Actionscript 2.0
Silly newbie question, but what is the proper syntax for this OLD style code in the new and improved 2.0?

on (release) {
tellTarget (this._parent.stars) {
gotoAndPlay(2);
}
}

Thanks

View Replies !    View Related
Convert A Javascript To Actionscript
I'm in MX2004, and need to convert a javascript function into an actionscript function. The original function was created by a developer friend who knows nothing of Flash, and I have no idea what he did.

The function is supposed to round a number up to the nearest 1/8 value and it works beautifully - in HTML. There is an input field named rawValue and an output field named calcValue. The function is below, and if anyone could help me with this I would be eternally grateful:

function roundUpTo(fromField,toField,fracValue){
// Get the "source" value field object reference
fromField = (fromField && typeof fromField.value != "undefined") ? fromField : null;
// Get the "target" value field object reference
toField = (toField && typeof toField.value != "undefined") ? toField : null;
// Make sure there is both a "source" and "target" field object reference
if(fromField && toField){
// Get (or evaluate) the "Fraction" parameter passed (if present) -- Default is 1/8
fracValue = (fracValue && (fracValue.match(/[^0-9.*/+-() ]/) == null) && !isNaN(parseFloat(eval(fracValue)))) ? parseFloat(eval(fracValue)) : (1/8);
// Get the original source value (NOTE: parseFloat is executed)
oV = (fromField.value != "" && !isNaN(parseFloat(fromField.value))) ? parseFloat(fromField.value) : 0;
// Get the Integer portion of the supplied original value
cVI = parseInt(oV);
// Get the Decimal portion of the supplied original value
cVF = oV - cVI;
// Round the Decimal portion down to the nearest "fraction" value
cVFD = (parseInt(cVF/(fracValue)) * (fracValue));
// Find the nearest "higher" fractional value
cVFD = ((cVF == cVFD) ? (cVF) : (cVFD + (fracValue)));
// Set the "target" field value to the "rounded up" value (to the nearest "higher" fraction value supplied, or 1/8 if not supplied)
toField.value = cVI + cVFD;
}
}

View Replies !    View Related
Convert Actionscript 2.0 Code To 3.0
I would like to incorporate a very basic paint program into my Flash movie.
I must use AS 3.0.

I followed the tutorial from the URL below, which I think is for AS 2.0.
[url="http://www.pixelhivedesign.com/tutorials/Flash+Painting+Program/"]

It doesn't even work for me using AS 2.0. When I try to play my movie it says "A script in this movie is causing Adobe Flash Player 9 to run slowly. If it continues to run your computer may become unresponsive. Do you want to abort the script?"

The code in the tutorial is:
canvasAbove = attachMovie('canvas_mc','can',2);
canvasAbove._alpha = 50;

painting = createEmptyMovieClip('painting',1);

theBrush = new Object();
theBrush.onMouseDown = function(){
isPainting = true;
painting.moveTo(_xmouse,_ymouse);
painting.lineTo(_xmouse+1,_ymouse+1);
}
theBrush.onMouseMove = function(){
if(isPainting){
painting.lineTo(_xmouse,_ymouse);
}
}
theBrush.onMouseUp = function(){
isPainting = false;
}
Mouse.addListener(theBrush);

painting.onEnterFrame = function(){
ranWidth = Math.round((Math.random() * 10)+2);
painting.lineStyle(ranWidth,0x006600,100);
}

clear_btn.onRelease = function(){
painting.clear();
}

Can anybody help me to convert this code into Actionscript 3.0?
Or do you have an alternative way to make a basic drawing program using AS3.0 and Flash?

Thank you,
Nicole

View Replies !    View Related
Convert Graph Into ActionScript
Is it possible to convert graph i draw in Flash into ActionScript?

View Replies !    View Related
Convert Java -> Actionscript
I need some help with this issue.

I want to convert code written in Java to Actionscript code.

Or to find the way to call Java applets with actionscript.

Pls. help!

View Replies !    View Related
Convert Form To ActionScript
I'm working with a flash designer, and we're both trying to convert an html form into actionscript so we can use it in flash, for my new site http://www.AutomaticMoneyMachine.com.

The form needs to call some variables from a line of php, so if it were all php and html, it would look something like this:

<?
session_start();
include("AMMscript.php");
?>

<form method="post"
action="http://www.webbootcamp.com/mail/signup.php">
<input type="hidden" name="list" value="19">
<font face="Sydnie"><font color="#00FF00"><font
size=+2>NAME/font></font></font>
<input type="text" name="fname" value="" maxlength="30"
style="font-family:arial; color:003300; font-size:15pt; background:ffff00;">
<p>
<font face="Sydnie"><font color="#00FF00"><font
size=+2>EMAIL/font></font></font><input type="text" name="email"
maxlength="80" style="font-family:arial; color:003300; font-size:15pt;
background:ffff00;">
<p><input type=submit class="link" value="CONFIRM TRANSACTION"></center>
<input type=hidden name=overwrite_dupes value=1>
<INPUT type="hidden" name="amount">
<INPUT type="hidden" name="user2" value="<? echo $Sponsor; ?>">
<INPUT type="hidden" name="user3" value="<fname>">
<INPUT type="hidden" name="user4" value="<? echo "$Firstname" ?> <? echo
"$Lastname" ?>">
</form>

The actual design elements of the form are not needed (my flash designer has duplicated that portion already). What we need to know, is how to send the hidden fields, and all values, and submit the form.

Also - is there anything special to know about grabbing php session variables into the flash, or can we just put the flash within a php page?

NOTE - the form goes to a mailing list, so it is imperative to somehow define the list number as shown here <input type="hidden" name="list" value="19"> after the form action.


I would be happy to give you free memberships to two separate bu^siness oppo^rtunities I run, http://www.WebBootCamp.com and upcoming http://www.AutomaticMoneyMachine.com to anyone who can help us out with this.

Thanks in advance!


Sincerely,

Jim Symonds
Founder, Web Boot Camp
http://www.WebBootCamp.com
The Webmaster Resources Search Engine
==== http://www.WebmasterNow.com ==
Learn 1001 Sneaky Tips 'n Tricks Now!
= http://www.WebSecretsExposed.com =

View Replies !    View Related
Toosl Used For Tracing An Image To Convert To Vectors
I have a hand drawn image and want to trace it with a PC tablet in order to convert it into vectors. What is the best tool to use for this?
- Flash
- Abode Streamline
- Freehand
- Corel
- etc?

Rob

View Replies !    View Related
How To Convert A Drawing From SWF To Image/PDF Without Any Serverside Program
Hi All,

I need a help in AS 3.0. The requirement is, user needs to draw something and take a screenshot or in the PDF format from flash swf by clicking a Save button[Save button will be in the same flash file]. Is it possible in AS 3.0 without any other server-side program?

This is very urgent. Please let me know whether this is possible or not.

Thanks
Guru.

View Replies !    View Related
Convert Script To Flash 5 Actionscript
Howdy,

how would I write the following flash 4 actionscript in Flash 5 actionscript? basically im telling movie clip "menu" to GotoAndStop at a frame# that happens to be a variable. It works swell in flash 4 but i can't get the flash 5 syntax correct.



tellTarget ("../menu") {
gotoAndStop ((../:variable));
}

View Replies !    View Related
Convert Text To Curvres Via ActionScript
Is there a way to convert text to curvres via ActionScript?

View Replies !    View Related
Please Help Convert Flash MX Actionscript Into Version 5
Hi,

I helped someone creating a continously scrolling mc in MX. However, he needs it written in Flash 5... Do you know how to convert following code into Flash 5 AS language? The strange thing is, when I save the mx-fla as Flash 5, I get no error codes. But when I publish the movie with Flash 5, nothing happens.

I really appreciate your help!

The actionscript below is currently on frame 1 of the timeline, on the stage there is a mc named "content_1":

function deltaX() {
var a = this._xmouse;
var b = movieWidth/2;
var c = 20;
return 0-((a-b)/20);
}
function getMovieSize() {
var currentMode = Stage.scaleMode;
Stage.scaleMode = "showAll";
_global.movieWidth = Stage.width;
_global.movieHeight = Stage.height;
Stage.scaleMode = currentMode;
}
getMovieSize();
content_1.duplicateMovieClip("content_2", 1);
obj_1 = content_1;
obj_2 = content_2;
obj_1.num = 1;
obj_2.num = 2;
barWidth = obj_1._width;
obj_2._x = obj_1._x+barWidth;
this.onEnterFrame = function() {
obj_1._x += deltaX();
obj_2._x += deltaX();
if (obj_1._x>=0 && obj_1._x<=barWidth) {
obj_2._x = obj_1._x-barWidth;
} else if (obj_1._x<=movieWidth-barWidth) {
obj_2._x = obj_1._x+barWidth;
}
if (obj_2._x<=movieWidth-barWidth) {
obj_1._x = obj_2._x+barWidth;
} else if (obj_2._x>=0) {
obj_1._x = obj_2._x-barWidth;
}
};

View Replies !    View Related
Convert String Into Actionscript Code
I need one function that converts string into actionscript code,
i've been searching but I don't find anything. I'm using Flash 8.

Example:

myString = "Number(var1.txt) * Number(var2.txt) + 1000";

result.text = desiredFunction(myString); // is equal > result.text = Number(var1.txt) * Number(var2.txt) + 1000;


Thanks

View Replies !    View Related
Convert String Into Actionscript Code II
Please.. help me with this.

The function above arithmeticParser() by abeall works great BUT,
it doesn't read variables, if I have a variable name "var1" or an instance name "var1.text"
How can I assign to the array the value instead of the variable string?


actionscript layer1:
<code>
/************
/* String arithmetic parsing function - abeall.com
/* takes a string like "1+(5-2)/7((25+3)*2)" and does the arithmetic, respecting parenthesis
/* returns: Number
/************/
function arithmeticParser(str){
if(typeof str!='string')return str;
//clean up
str = str.split(" ").join('').split("Number").join('');

//CORE ALGORITHM///////////////////////////////////
//create nested arithmetic array based on parenthesis
//ex: 1+(5-2)/7((25+3)*2) => ['1','+',['5','-','2'],'/','7',[['25','+','3'],'*','2']]
var arithArr = [];
var currStr = "";
var arrayScope = [arithArr];
for(var i=0 ; i<str.length ; i++){
var char = str.charAt(i);
var currArr = arrayScope[arrayScope.length-1];
if(char=="("){
if(currStr!="")combineArray(currArr,currArr.length ,arithStrToArray(currStr.split("(").join()));
currStr = "";
arrayScope.push(currArr[currArr.length]=new Array());
}else if(char==")"){
combineArray(currArr,currArr.length,arithStrToArra y(currStr.split(")").join()));
currStr = "";
arrayScope.pop();
}else{
currStr = currStr + char;
}
}
combineArray(currArr,currArr.length,arithStrToArra y(currStr));
//dump(arithArr);
str = arrayArithmetic(arithArr);
return str;

//FUNCTIONS////////////////////////////////////////
//splices all elements in the Array 'insertArr' into the Array 'ar' at 'index'
function combineArray(ar,index,insertArr){
for(var i in insertArr){
ar.splice(index,0,insertArr[i]);
}
}

//performs arithmetic() to 3D arrays from deepest array to the top array
function arrayArithmetic(ar){
for(var i in ar){
if(typeof ar[i]=='object'){
ar[i] = arrayArithmetic(ar[i]);
}
}
return arithmetic(ar);
}

//converts arithmetic string to array
//ex: 7+2/8-12 => ['7','+','2','/','8','-','12']
function arithStrToArray(arithStr){
var ar = [];
var currStr = "";
for(var i=0 ; i<arithStr.length ; i++){
var char = arithStr.charAt(i);
if(char=="/" || char=="*" || char=="-" || char=="+"){
if(currStr!="")ar.push(currStr);
ar.push(char);
currStr = "";
}else{
currStr = currStr+String(char);
}
}
if(currStr!="")ar.push(currStr);
return ar;
}

//performs the four basic arithmetic operations to arithmetic formatted array
function arithmetic(ar){
for(var i=0 ; i<ar.length ; i++){
if(ar[i]=="/"){
var n = Number(ar[i-1]) / Number(ar[i+1]); //perform operation
ar.splice(i-1,3,n); //splice out the number,operation,number subarray and replace with the answer number
i=0; //since the array has been modified(spliced) the operation must start over to get all operations
}
}
for(var i=0 ; i<ar.length ; i++){
if(ar[i]=="*"){
var n = Number(ar[i-1]) * Number(ar[i+1]);
ar.splice(i-1,3,n);
i=0;
}
}
for(var i=0 ; i<ar.length ; i++){
if(ar[i]=="-"){
var n = Number(ar[i-1]) - Number(ar[i+1]);
ar.splice(i-1,3,n);
i=0;
}
}
for(var i=0 ; i<ar.length ; i++){
if(ar[i]=="+"){
var n = Number(ar[i-1]) + Number(ar[i+1]);
ar.splice(i-1,3,n);
i=0;
}
}
return ar[0]; //the array should be down to one element: the answer
}
}
</code>

actionscript layer2:
<code>
myString = "(var1 * 2) + 1000";
result.text= arithmeticParser(myString);
</code>

View Replies !    View Related
Convert FlashVars (html) To Actionscript
How do I convert a FlashVars statement (inside an HTML file) to a statement in actionscript?

Example, suppose I have this snippet of code in an HTML file:




Code:
<embed src="ordering.swf" FlashVars="xmlfile=ordering1.xml&actNum=1"

In English, the above code passes in two parameters "xmlfile" and "actNum" to the loading of ordering.swf.

MY QUESTION: How can I emulate this behavior of FlashVars if I wanted to bypass any HTML file -- using actionscript. How do I pass two parameters into a loading movie?

In other words, I think I need to use the loadmovie command - but how do I pass these two parameters using loadmovie? If I'm not supposed to use loadmovie, then any other suggestions are greatly welcomed!

I have 2 files:

1. Ordering.Swf (as noted in the code above)
2. Parent.Swf (which loads the external ordering.swf passing the two parameters xmlfile and actNum into it)

What is the code for step 2?

Thanks!

View Replies !    View Related
How Do You Convert Text To Bitmap In Actionscript
I am doing an animation which includes some text floating around the stage. This however displays some unwanted effects. I believe i can convert my text to bitmap using actionscript but am not sure how to implement this. Is there anyone out there using a/s 3 who might be able to help me. Many Thanks.

View Replies !    View Related
[F8] Easy Way To Convert Text To Actionscript
im working on a new game that will allow users to create their own levels and share via copy and paste.

when the map is create it presents the user with a few arrays for the level data.

Is there an easy way to just load the text with actionscript or would i have to parse everything?

View Replies !    View Related
Convert Flashvars To Actionscript Statement
How do I convert a FlashVars statement (inside an HTML file) to a statement in actionscript?

Example, suppose I have this snippet of code in an HTML file:


Code:
<embed src="ordering.swf" FlashVars="xmlfile=ordering1.xml&actNum=1"
In English, the above code passes in two parameters "xmlfile" and "actNum" to the loading of ordering.swf.

MY QUESTION: How can I emulate this behavior of FlashVars if I wanted to bypass any HTML file -- using actionscript. How do I pass two parameters into a loading movie?

In other words, I think I need to use the loadmovie command - but how do I pass these two parameters using loadmovie? If I'm not supposed to use loadmovie, then any other suggestions are greatly welcomed!
Thanks!

View Replies !    View Related
Convert Java Code To ActionScript
Hi All,

Here I am attaching a java class regexp.txt , which I need to convert to ActionScript code. Please help .............

View Replies !    View Related
Convert Mask From Timeline To Actionscript 3 (AS3)
I have a mask that I've created on a layer in the timeline. Is it possible to convert it so that I can use it in AS3

View Replies !    View Related
How Can I Convert An ActionScript 2 Website To ActionScript3?
I have a website which currently uses Action Script 2.
When I change the Publish settings from Flash 7 to Flash 9 and from ActionScript 2 to ActionScript 3, then publish the file, I get the following warning:

WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.

What can I do to correct this error?
Is there a simple tutorial that explains how to make the changes?
I subscribe to Lynda.com but I haven't seen useful there.
I should warn you that I am a beginner when it comes to coding.

Thank you

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved