ActionScript 3.0 :: Turn Loader Data Into A MovieClip?
Jan 9, 2011I'm using a loader to make it so people can upload their own images to my swf. This is basically what code I'm using [code]...
View 9 RepliesI'm using a loader to make it so people can upload their own images to my swf. This is basically what code I'm using [code]...
View 9 Replieshow to create an image gallery that loads external bitmaps. It also has some nice fade in/fade out effects using Tweener. I was wondering, what would I need to modify from my code to load MovieClips from the library instead of the external JPEGs.
Code:
import caurina.transitions.Tweener;
var btn:Object;
var disabledBtn:Object;
[Code].....
QUESTION NUMBER ONE
I have e.target.data value like below
1.
2.
3.
and i have a textarea component.i used this below script to insert my e.target.data to the textarea component
ActionScript Code:
my_textarea.htmlText = e.target.data
then, my_textarea look like plain text, it still 1.
2.
3.
but when i do like below
ActionScript Code:
my_textarea.htmlText = "1.[code]......
I'll start off by saying I'm a newbie, just putting that out there. How do you make a turn by turn multiplayer flash game? I don't know if an engine is made in AS3, PHP, Javascript, or whatever,I made my game already, it's just that it isn'tmultiplayer yet. Basically, there are lines, and each player crosses out a number of lines, and the last player to cross out a line is the loser. I want it where one user crosses out some lines, then presses End Turn, then the other does their turn and then presses End Turn to allow the other player to move his cursor. But how can I get both players to see the same frame and only have one player have the ability to move the cursor during a turn? Is there some easily adaptable multiplayer engine for flash for newbies out there
View 2 RepliesDoes anybody has a source file I could use as an example on how to make a display to turn (flip) around and show the other side
View 3 RepliesI've recently started using the cache as bitmap switch on my on-stage movieclips, to great success, while creating my isometric RPG. What I can't grasp though, is how to apply it to AS-instantiated classes/object.How can I turn on cacheAsBitmap inside a class that extends movieclip? Alternatively, how can I do it from outside the class, from another class that adds mentioned movieclip to the stage?
View 1 Repliesi was folowing the tutorial here about amfphp and loading mysql data, this worked very good. But i was wondering, is their a way to know how much kb in data u are loader?
Like the bytesTotal and bytesLoaded with a Loader / URLLoader?
After posting the jsp with username and password, i got following information from server.
private function CompleteHandler(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);
trace(loader.data); \ trace the received data
[Code]....
How to get the user_currency_code , user_balance , usertypecode, user_id , respond ?
I am new to action script 3.0. o understand how can I load data with URLLoader.So, I have an aplication like:
var PATH:String = "http://www.somesite.com/myFirstPage.php?a=10&b=20";
var urlRequest:URLRequest = new URLRequest(PATH);
var urlLoader:URLLoader = new URLLoader();
[code].....
I have a problem with connecting as3 with php. I get the data return from php is wrong.
This is my code
AS3:
var file:String="test.php";
// Define global variable
function GetXMLfile(){
var loaderphp:URLLoader=new URLLoader();
var urlRequest1:URLRequest = new URLRequest(file);
loaderphp.addEventListener(Event.COMPLETE, GetCharInfo);
[Code] .....
This is something I noticed on the Adobe documentation pages.
When receiving a textfile from a URL, the function to set the text will either look like this:
function completeHandler(event:Event):void {
var txt:String = URLLoader(event.currentTarget).data as String;
tf.text = txt;
[Code].....
I need a script that clears all the XML data from a loader (swf container).
How can I unload the XML cache so I can put new information to replace the old stuff?
I found out this will not work:
Code:
var Slice1:Sprite = new Sprite();
Slice1.addChild(evt.target.loader);
var Slice2:Sprite = new Sprite();
Slice2.addChild(evt.target.loader);
I found out the hard way what happens when you and the same object to multiple parents (it packs up, and moves out).So what is the work around for this, besides multiple loaders? LoaderMax? My evt.target.loader is an image. So maybe bitmap data?
I am having a bit of an issue with my traces not working. Basically I have 4 loaders that loads up XML data and displays it for it to be checked. My issue is that the first two traces work for the first two loaders but the last two traces do not work. Usually I get a 1009 error if I try to dig into the data.[code]...
View 7 RepliesWhy this does not work?...It should send and load Vars but it does not even trigger when complete...
var postVars:URLVariables = new URLVariables();
postVars.userId='cat';
postVars.folderId='dog';
var request:URLRequest = new URLRequest();
[Code] .....
in AS2, I used loadVars class to download data, but I am not sure if I should use loader calss or URLLoader for loading data in AS3.
View 1 RepliesI'm having troubles accessing the data loaded by external class.[code]...
Now, I want to create another external class (called MainMenu) that will be initiated from the Main class.This class should create the menu based on the loaded XML class.
My question is, how can I make use of the loaded XML content via XMLLoader class within the MainMenu class?
I am calling some data from php, which simply retrieves some data from MySQL. The tables retrieved are called dynamically and so I have a list of those tables sent to actionscript below and called by event.target.data.its and event.target.data.ces. These will have a list of the tables called. I then send the name/value pairs to actionscript from php by using those table names (all inside of php here) dynamically.
$sql3 = "SELECT * FROM `specialties`";
$getit = mysql_query($sql3);
while($row2 = mysql_fetch_array($getit)){
for($i=0;$i<sizeof($itlist);$i++){
[Code]....
I have been working on a flex application with java, as i have used Life Cycle Data Service for communication, i wana know, is there any function of flex, where i can see the loading status in percentage, that how much record is being loaded.Problem is, if there is lengthy record, no body comes to know, whats happening with software, like in Comboboxes or Grids, users usually think it as a BUG in application, but ofcourse it is not.I need such graphical loader, which keeps on loading with proper status in percentage, until it receives all data from JAVA (SQL Server).
View 2 RepliesTrying to make a grid based question answer game and load variables from a text file using for loops into an array. I wanted to reduce redundant code and use for loops to populate my arrays. The issue I am having is with my arrays being lost/destroyed outside of the loader function.
I understand that if an array is declared inside the function, naturally the array would be destroyed upon exit of the function. However I am declaring the arrays outside of the function so the arrays should remain intact after I exit the function.
BTW - I'm not having an issue with the loading of the data. The data is loading correctly. The array is simply being destroyed after the data has loaded.
//Create the arrays to hold the
//categories, questions, and answers
var categoryArray:Array = new Array();
var quesAnswArray:Array = new Array();
[Code].....
I'm building a simple flash webpage using as3 in order to get accustomed to it. I've got some code for a preloader which, the end result works fine,but I cannot get the preloader assets to update with the loader data.To put it simply, I cannot get the code to update my text field that would display the percent done text.It only shows at 100 when it should go 1, 2, 3, 4...etc.Also I cannot get the bar_mc (just a simple bar graphic) to scale along with the percent loaded.
Code:
function handleLoadProgress(e:ProgressEvent):void {
while (percentDone < 100) {
totalBytes = loaderInfo.bytesTotal;[code]....
I'm making a card game and each card has a certain symbol on it which is loaded from an external .png file. I don't want to make it so that it has to load the .png every time it make a card, so I made it load in the preloader/background. How do I make new objects that looks the same as the loader, like copying the loader's data or something?
View 1 RepliesSo I am trying to load variables from a .php file into a movie clip and then plug in those variables to various fields and for some reason its not working...so heres whats going on...(this is for the staff page for my church)
In the primary timeline we have this line...
loadVariables("./middleware/staff.php?id=" + staffID,
staff_panel, "GET");
We are loading the variables into the movie clip which contains our various fields...the value for staffID is created in the previous frame when the user click on that person's icon, we know for sure that this is being passed correctly to this frame, because I have a text box in the main timeline which displays the number.
The resulting string from the .php file looks like this...
staffNameE=Jason+Webb&staffTitleE=Lead+Pastor&staffDescE=Jason's+bio+g oes+here...&picLoader=./images/staff_pics/jwebb.jpg&staffEmail=webmast er@brooklife.org
Within the movie clip that the variables are being loaded into we have this....it loops till the var load is done and then writes the information to the fields...
while (L ne "stop"){
if (staffNameE ne ""){
staffName = staffNameE;
[Code].....
So I am trying to load variables from a .php file into amovie clip and then plug in those variables to various fields andfor some reason its not working...so heres whats going on...(thisis for the staff page for my church) (and yes I have read theutorials :P )In the primary timeline we have this line...
loadVariables("./middleware/staff.php?id=" + staffID,
staff_panel, "GET");
We are loading the variables into the movie clip whichcontains our various fields...the value for staffID is created inthe previous frame when the user click on that person's icon, weknow for sure that this is being passed correctly to this frame,
I want to end any previous data loading progresses.. But I can't manage to do this.
I tried lots of things (as you can see couple of them below), but it just can't stop downloading of images. I click to first gallery button, it starts to download thumbs and the first picture. Then I click to second gallery button and it adds more download progress to the previous ones.. (Every gallery has 4 thumb, this way every click adds 4 thumb and 1 picture. It's download count grows 5+5+5 to infinite) This code is from my thumb class.. Every thumb downloads it's own little image..
[Code]...
I have an arbitrary number of files that I need to load in an AIR app.I want to iterate through an array of File object and create and launch Loaders for each one's File.url.When they are done (event COMPLETED or IOErrorEvent.IO_ERROR), I want to stuff their data somewhere. If they fail, I want to make an exception report. I cannot find any way to reference the File object from the event listener (certainly not the IO_ERROR)The best way would be to create individual event handlers for each Launcher that had the File information "hard-coded" into it. At the very least, I could use the function itself as an index to a Dictionary:
foo(fileToLoad : File) : void
{
var theCompletedHandler : Function =
{
[code]....
Can I use event.currentTaget and use the Loader instance as an index? Will that have any weird dependencies ?
I have an XML-file which holds some info about picture and text.A designer have made some mc's and I have to load the pictures (which has URL from XML) into this mc-animation. I can only load the images into the loader and then I cant get the image from the loader in memory into the animated timeline mc. how this is done? I have tried addChild but this doesnt help me attach the loaded picture to the anim_mc. or...?The designer also have a textlayer, which is put in a mc and then animated. And the text from XML must go into the textfield and be animated.
View 5 Repliesi have created a preloader for my swf file. I want to simply add an image onto the stage whilst another swf is loading. My image is saved in a movieclip called image in the library. How would i add it to the stage and make it stay there whilst it is being loaded. I have tried manually moving it onto the stage but it only stays for 1 frame.
import flash.display.*;
import flash.events.*;
import flash.text.*;
[code].....
I am trying to convert the [Loader Object] into the MovieClip but could't do it. Please see the comment in to code to see my problem. The reason i want to do this is because i have other movieclips on my code, I like to be able to use those code instead of converting the code to works with the loader object.[code]
View 3 Repliesi have created a preloader for my swf file. I want to simply add an image onto the stage whilst another swf is loading. My image is saved in a movieclip called image in the library. How would i add it to the stage and make it stay there whilst it is being loaded. I have tried manually moving it onto the stage but it only stays for 1 frame.
import flash.display.*;
import flash.events.*;
import flash.text.*;
[code]....