Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

leonardonobre

InputText e LoadVars

Recommended Posts

Boa noite amigos,

no código abaixo tenho uma dúvida em relação ao carregamento de um input text juntamente com um LoadVar de algumas outra variaveis do código.

 

O que quero fazer é enviar o meu input text (de nome pernr) e as variaveis do meu BitmapData com um único clique no botão que irá gerar e enviar o meu input text para um arquivo PHP.

 

Código

import flash.display.BitmapData; // Bitmap
import flash.filters.DropShadowFilter
import flash.filters.BlurFilter;
import flash.geom.Matrix;
import flash.filters.ColorMatrixFilter;

var output_vid:Video; 
var my_cam:Camera = Camera.get();
output_vid.attachVideo(my_cam); 

var matrix:Array = new Array();
	matrix	   = matrix.concat([1, 0, 0, 0, 0]); // Vermelho
	matrix	   = matrix.concat([0, 1, 0, 1, 0]); // Verde
	matrix	   = matrix.concat([0, 0, 1, 0, 0]); // Azul
	matrix	   = matrix.concat([0, 0, 0, 1, 0]); // Alpha de Cor

var filterCol:ColorMatrixFilter   = new ColorMatrixFilter(matrix);	
var shadowFilter:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 20, 20, 2, 2, false, false, false)
var blur:BlurFilter			   = new BlurFilter(0, 0, 0);

myFilters	= new Array(shadowFilter, blur, filterCol)
colF.onPress = mx.utils.Delegate.create(this,makeColor);
shaF.onPress = mx.utils.Delegate.create(this,makeShadow);
bluF.onPress = mx.utils.Delegate.create(this,makeBlur);

function makeShadow() { capture(1) }
function makeBlur(){ capture(1) }
function makeColor(){ capture(0) }

function capture(nr){
	this["snapshot"+nr] = new BitmapData(160,120);	

	this["snapshot"+nr].draw(output_vid,new Matrix());
	var t:MovieClip = createEmptyMovieClip("bitmap_mc"+nr,100);
	t._x = 300;
	t._y = 0;

	t.attachBitmap(this["snapshot"+nr],1);
	var filterArray = new Array(myFilters[nr])
	t.filters = filterArray
	// attachMovie("print_but", "bot"+nr, 200+nr, {_x:t._x+t._width-60, _y:t._y+t._height/2})	
	attachMovie("print_but", "bot"+nr, 400+nr, {_x:t._x+t._width-120, _y:t._y+t._height-(-90)})	
}

function output(nr){

		var pixels:Array = new Array()
		var snap = new BitmapData(this["snapshot"+nr].width, this["snapshot"+nr].height);	
		myMatrix = new Matrix();
		snap.draw(this["snapshot"+nr],  myMatrix);
		var w:Number = snap.width, tmp
		var h:Number = snap.height

		for(var a=0; a<=w; a++){
			for(var b=0; b<=h; b++){
				tmp = snap.getPixel32(a, b).toString(16)
				pixels.push(tmp.substr(1))
			}
		}
		
		var pernr:Number = _root.pernr.value;
		trace(pernr);
		
		var output:LoadVars = new LoadVars();
			output.img		  = pixels.toString();
			output.height	   = h;
			output.width		= w;
						output.pernr		= pernr;
			  output.send("show.php", "output", "POST");
}
stop();

Abraços,

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.