Olá,
Tenho um arquivo as que é usado em um .fla, ele faz o upload da imagem da maquina para tela, preciso aplicar drag na imagem que recebe o upload, pra arrastar ela na tela,
tentei vaias coisas mas não rolou, se alguem souber como me ajudar abaixo tem o script que tenho.
Nesse link tem algumas coisaas sobre drag, o problema é que não sei juntar os dois scripts;
http://gestureworks....tutorials/drag/
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.net.*;
import flash.display.*;
import flash.events.*;
import flash.utils.ByteArray;
import flash.net.URLRequest;
import flash.net.URLLoader;
public class uploadImage extends Sprite
{
private var jagFileRefSave:FileReference = new FileReference();
private var loader:Loader = new Loader();
private var imagesFilter:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");
private var textFilter:FileFilter = new FileFilter("Text Files (*.php,*.xml)", "*.php; *.xml");
private var imgContainer:ImgContainer;
private var allTypes:Array;
private var UrlRequest:URLRequest;
public function uploadImage()
{
super();
allTypes = new Array(imagesFilter, textFilter);
UrlRequest = new URLRequest("uploader_script.php");
upload_Image.addEventListener(MouseEvent.CLICK,onClickSave);
upload_btn.addEventListener(MouseEvent.CLICK, uploadVars);
//jagFileRefSave.addEventListener(ProgressEvent.PROGRESS, progressHandler);
}
private function onClickSave(e:MouseEvent):void{
file_name.text = "";
file_size.text = "";
if(getChildByName("imgContainer") != null)
{
removeChild(getChildByName("imgContainer"));
}
jagFileRefSave.browse(allTypes);
jagFileRefSave.addEventListener(Event.SELECT, selectedFile);
}
private function selectedFile(e:Event):void
{
fileDisplay_txt.text = jagFileRefSave.name;
jagFileRefSave.load();
if((jagFileRefSave.type == ".php") || (jagFileRefSave.type == ".xml"))
{
file_name.text = "Selected file name is : "+jagFileRefSave.name;
file_size.text = "Selected file size is : "+(jagFileRefSave.size/1024)+" KB";
}
else
{
jagFileRefSave.addEventListener(Event.COMPLETE, loaded);
}
}
private function uploadVars(e:MouseEvent):void
{
if(fileDisplay_txt.text != "")
{
jagFileRefSave.upload(UrlRequest);
status_txt.text = jagFileRefSave.name + " has been uploaded.";
fileDisplay_txt.text = "";
}
}
private function loaded(e:Event):void{
var rawBytes:ByteArray = jagFileRefSave.data;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, getBitmapData)
loader.loadBytes(rawBytes);
}
private function getBitmapData(e:Event):void
{
imgContainer = new ImgContainer();
imgContainer.name = "imgContainer";
imgContainer.addChild(loader);
imgContainer.x = stage.stageWidth/2 - imgContainer.width/2;
imgContainer.y = stage.stageHeight/4;
addChild(imgContainer);
}
}
}
- Fórum WMO
- → Viewing Profile: Tópicos: claudio msilva
Community Stats
- Group Usuários
- Active Posts 8
- Profile Views 2982
- Member Title Novato no fórum
- Age Age Unknown
- Birthday Birthday Unknown
-
Sexo
Male
-
Localidade
são paulo
1
Neutral
User Tools
Friends
claudio msilva hasn't added any friends yet.
Topics I've Started
Aplicar Drag Em As
09/08/2011, 19:13
Mailto Com As3 Abrindo Janela Errada
02/05/2011, 11:34
Tenho um botão e ao clicar quero que abra o outlook o código que inclui faz isso mas ele também abre uma janela do browser desnecessariamente, já tentei remover a linha
navigateToURL(email); mas ai deixa de funcionar
clicado.buttonMode = true;
clicado.addEventListener(MouseEvent.CLICK, mailto);
function mailto(event:MouseEvent):void {
var email:URLRequest = new URLRequest("mailto:cliente@site.com.br");
navigateToURL(email);
}
stop();
navigateToURL(email); mas ai deixa de funcionar
clicado.buttonMode = true;
clicado.addEventListener(MouseEvent.CLICK, mailto);
function mailto(event:MouseEvent):void {
var email:URLRequest = new URLRequest("mailto:cliente@site.com.br");
navigateToURL(email);
}
stop();
Atribuir Alpha 0 Em Movieclip
14/03/2011, 17:08
Estou tentando atribuir alpha 0 ou parar action mas ele continua na tela
primeiro tenho isso:
var numOfRain:uint = 50;
var rainArray:Array = new Array();
var rippleArray:Array = new Array();
for (var i:uint = 0; i < numOfRain; i++) {
var rain:RainDrop = new RainDrop();
addChild(rain);
rain.alpha = 0.4 + Math.random() * 0.6;
rainArray.push(rain);
var ripple:Ripple = new Ripple();
addChild(ripple);
rippleArray.push(ripple);
ripple.y=-250;
}
stage.addEventListener(Event.ENTER_FRAME, raining);
function raining(evt:Event):void {
for (var i = 0; i < rainArray.length; i++) {
var rainParticles = rainArray[i];
var gotasParticles = rippleArray[i];
rainParticles.y += rainParticles.yVelocity;
rainParticles.x += rainParticles.xVelocity;
if (rainParticles.y > 600 + Math.random() * 600) {
gotasParticles.x = rainParticles.x;
gotasParticles.y = rainParticles.y;
gotasParticles.play();
rainParticles.x = Math.random() * 1024;
rainParticles.y = -10;
}
}
}
no decorrer da timeline atribuo isso
stage.removeEventListener(Event.ENTER_FRAME, raining);
rain.alpha = 0;
as gotas param mas continua na tela, tentei duplicar toda ação mas não funcionou.
primeiro tenho isso:
var numOfRain:uint = 50;
var rainArray:Array = new Array();
var rippleArray:Array = new Array();
for (var i:uint = 0; i < numOfRain; i++) {
var rain:RainDrop = new RainDrop();
addChild(rain);
rain.alpha = 0.4 + Math.random() * 0.6;
rainArray.push(rain);
var ripple:Ripple = new Ripple();
addChild(ripple);
rippleArray.push(ripple);
ripple.y=-250;
}
stage.addEventListener(Event.ENTER_FRAME, raining);
function raining(evt:Event):void {
for (var i = 0; i < rainArray.length; i++) {
var rainParticles = rainArray[i];
var gotasParticles = rippleArray[i];
rainParticles.y += rainParticles.yVelocity;
rainParticles.x += rainParticles.xVelocity;
if (rainParticles.y > 600 + Math.random() * 600) {
gotasParticles.x = rainParticles.x;
gotasParticles.y = rainParticles.y;
gotasParticles.play();
rainParticles.x = Math.random() * 1024;
rainParticles.y = -10;
}
}
}
no decorrer da timeline atribuo isso
stage.removeEventListener(Event.ENTER_FRAME, raining);
rain.alpha = 0;
as gotas param mas continua na tela, tentei duplicar toda ação mas não funcionou.
Aspmail Terra
14/02/2011, 11:26
Estou tentando enviar dados por um formulário no terra e com eles não tem suporte estou tetando ajuda aqui...
Recebi o código abaixo deles, mas agora precisa criar a pagina com os campos e integrar a ela, só recebo a mensagem que esta no campo bodyText, preciso expandir paa incluir nome, email, telefone
<%
' Cria o componente aspmail
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
' Nome do Remetente
Mailer.FromName = "xxx"
' E-mail do Rementente
Mailer.FromAddress= "xxx@xxx.com.br"
' Servidor de envio de e-mail
Mailer.RemoteHost = "mail-fwd"
' Nome / Endereço de quem recebera o E-mail
Mailer.AddRecipient "Cliente", "xxx@xxx.com.br"
' Assunto do E-mail
Mailer.Subject = "ASPMAIL!!!"
' Campo da mensagem
Mailer.BodyText = "Testando o ASPMAIL"
if Mailer.SendMail then
Response.Write "E-mail enviado"
else
Response.Write "Erro no envio do e-mail. Erro: " & Mailer.Response
end if
%>
Recebi o código abaixo deles, mas agora precisa criar a pagina com os campos e integrar a ela, só recebo a mensagem que esta no campo bodyText, preciso expandir paa incluir nome, email, telefone
<%
' Cria o componente aspmail
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
' Nome do Remetente
Mailer.FromName = "xxx"
' E-mail do Rementente
Mailer.FromAddress= "xxx@xxx.com.br"
' Servidor de envio de e-mail
Mailer.RemoteHost = "mail-fwd"
' Nome / Endereço de quem recebera o E-mail
Mailer.AddRecipient "Cliente", "xxx@xxx.com.br"
' Assunto do E-mail
Mailer.Subject = "ASPMAIL!!!"
' Campo da mensagem
Mailer.BodyText = "Testando o ASPMAIL"
if Mailer.SendMail then
Response.Write "E-mail enviado"
else
Response.Write "Erro no envio do e-mail. Erro: " & Mailer.Response
end if
%>
Envio Não Reconhece Iso-8859-1
24/01/2011, 13:25
Estou enviando dados por um formulário mas não reconhece acentos
No header tenho:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt" lang="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="pt-br" />
<head ('Content-type: text/html; charset=ISO-8859-1')>
No php
<?php
$headers= "MIME-Version: 1.0\r\n";
$headers= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers= "Content-Class: urn:content-classes:message\n";
$nome = $_POST["nome"];
$email = $_POST["email"];
$objetivo = $_POST["objetivo"];
$objetivo=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $objetivo);if($nome=="" || $email=="" || $objetivo=="" ){
$errors=1;
$error.="";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
$error.="";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$userip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$message= utf8_decode($message);
$message="Nome: ".$nome."
E-mail: ".$email."
Objetivo: ".$objetivo."
";
$message = stripslashes($message);
mail("meu@site.com.br","Agendar ",$message," ");
?><?php
}
?>
ao receber os dados o que tem acento vem com interrogalça
No header tenho:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt" lang="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="pt-br" />
<head ('Content-type: text/html; charset=ISO-8859-1')>
No php
<?php
$headers= "MIME-Version: 1.0\r\n";
$headers= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers= "Content-Class: urn:content-classes:message\n";
$nome = $_POST["nome"];
$email = $_POST["email"];
$objetivo = $_POST["objetivo"];
$objetivo=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $objetivo);if($nome=="" || $email=="" || $objetivo=="" ){
$errors=1;
$error.="";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
$error.="";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$userip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$message= utf8_decode($message);
$message="Nome: ".$nome."
E-mail: ".$email."
Objetivo: ".$objetivo."
";
$message = stripslashes($message);
mail("meu@site.com.br","Agendar ",$message," ");
?><?php
}
?>
ao receber os dados o que tem acento vem com interrogalça
- Fórum WMO
- → Viewing Profile: Tópicos: claudio msilva
- Privacy Policy
- Regras ·