ActionScript 3.0 :: Loading Dynamically GIF Ani To Flash?
Oct 19, 2009It's possible to load dinamically gif animation to Flash? I tried but only loads the 1st frame and was wondering if I'm doing something wromg or can't be done.
View 1 RepliesIt's possible to load dinamically gif animation to Flash? I tried but only loads the 1st frame and was wondering if I'm doing something wromg or can't be done.
View 1 RepliesEssentially, I've got a MC container that's created dynamically based off an XML file (basically for every <title></title> I've got, it makes a new "card"). Now within the context of each <title></title> grouping I've got <imgs></imgs> in which I specify the path to images that are related.All of that works perfectly, save for the external jpg files actually appearing on the stage. The MC I add them to does, but the external image doesn't.My problem is- I can't add the external images until they're completely loaded (or so it appears). The thumbnail BG I use is blank. So I know for a fact that the thumbnail BG isn't occluding the loaded thumbnails.
View 2 RepliesWe're using a content management system and client wants to upload videos. These videos will be for advertisers or directory listings. The videos will be converted on the fly to flv. Using flash8 flv component. Depending on the URL, I need the swf to access the correct video from a dynamically created xml file. I'm able to get the swf to recognize the current URL, and I put the URL into a variable called pageURL. Based on this URL, I need the swf to send this to the xml, with php - it will determine what video to get from database - based on the URL sent. I then need the swf file to play the correct video from the xml file.
View 1 RepliesI would like to have a flash movie load a picture as the background image of a symbol or otherwise be viewable. The picture would be referenced via a URL on another site.Example. putting in a URL ending in '.jpg' would make another object show the pic from that URL.
View 8 RepliesI am loading a text dynamically from flash which pulls the text up from either HTML or txt file and is lacking showing some special characters, more specifically it doesn't show the apostrophe ( ' ) what I am in need for now.
View 1 RepliesI'm trying to create an as3 project that dynamically pulls images from a database and sticks them into the framework of a flash movie that I making with this. Currently I am following a tutorial (in as2, and I am converting it to as3 as I go along) and am trying to get images to load from the same directory as the project, but I am having issues with the Loader. I am a complete newb at as3 and as such have almost no idea what I am doing,Here is the entire code from my project.
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;
[code]......
I'm using TLF text, so there's a RSL involved. I get that there's a way to include the library in my own code, but I'd rather not do that unless there's no other solution.
In Advanced Action Script Settings > Preloader Method, there's a choice between "Preloader SWF" (five black dots, the default thing) and "Custom preloader loop". My first question is then how to use this Custom preloader loop thing? What is it referencing? Do I have to write a special thingy somewhere? What?
And I already made a simple "bar filling up" kind of preloader, which I'm testing by using the aforementioned "Custom preloader loop" setting and simulating download. (My project no longer compiles when not simulating download [VerifyError: Error #1014: Couldn't find flashx.textLayout.container::ContainerController class.] which led to the conclusion that I'm doing something wrong here.) It does fill up, but it starts at about 60%. From my earlier badly worded Google searches, I think my problem is that I am using a bunch of external .as files which are loading before the preloader. Is there any way to tie the .as files later, or something?(That, or my preloader actually takes up 60% of the project's data, which would surprise me but isn't impossible because it's still very bare.
I'm making a game and I'm sorta kinda using tiles to render the map screen. So I have a bunch of sprites on screen, for which I created a Refresh() method that I call whenever necessary. In this method, I use a Loader object to load desired bitmaps (which aren't in the project's Library), then add this Loader as a child. The main reason I did it that way is because I could then reference the images to load with a string, and so include arguments in there.
(I don't know if I'm clear, so let my try to be more descriptive. I basically have an array containing the map data. I'll read that array and pass some properties as arguments to my Refresh() method to draw the screen correctly. I'll then be able to load the image ["sprite" + arg1 + arg2 + ".png"] by using that string to create a new URLRequest (and then use that in the Loader).If I understand the way this works correctly (and I probably don't ), I'm downloading the images all over again each time I call Refresh instead of having them "cached" somewhere, which is inefficient (because they're tiles and I'm reusing them multiple times). Am I correct in that assumption?
I thought the more "efficient" way would be to import my tiles in the project Library and export these for ActionScript. (They're PNGs, so they inherit from BitmapData.) My problem with this method is that to use these images, I now have to instantiate a class, so there's no string involved, and so I can't concatenate variables with a string anymore to fetch the right PNG to display, which is really, really annoying.
So I'd like to have the best of both worlds: cache images while still being able to refer to them with a string. Is that possible? And more generally, what's the "right" way to dynamically render images in the context of a tile-based map?
EDIT:public vars vs. getters and setters I have classes with properties. I've gathered that it's good programming practice to declare these properties as private vars and then define getter and setter functions to access them. It's easier to just declare these variables as public and move on. What are the pros and cons of both methods?
I have a parent SWF (Parent) that handles user navigation between multiple children SWFs (Child_1, Child_2, Child_3). How do I add event listeners to the navigation buttons on the children SWFs so that the user can move laterally between Child_1, Child_2 and Child_3? I can think of two options but can't get either one to work:
1) The parent SWF sets up the event listeners when it loads a child. So, I use a loader on Parent to load Child_1 and in Parent add eventlisteners to Child_1.myNavigationform.myButton.
The problem here is that the Parent is only handing the loader instance and I can't think of how it would drill down to the individual objects within Child_1.
2) Child_1 adds the event listeners to its own objects. This just reverses the problem. Child_1 has no problem accessing its own buttons but when a user clicks them it has no way of accessing methods on parent so that Child_2 can be loaded.
I have run into a very strange problem with Flash and Flex. It appears that under certain circumstances, movie clips from a SWF loaded at runtime (using Loader) cannot be instantiated if another SWF has been loaded in the mean time. Here is the complete code for a program that reproduces the error. It is compiled using mxmlc, via Ensemble Tofino:
[Code]...
I'm trying to get flash to load PHP dynamically generated XML. The flash file should display jpg images of the thumbnails in the XML file. However when I new_release.swf is not displaying any images.
The following is my flash file:
new_release.fla
Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
[code]....
I am using an external actionscript file, and I have dynamically loading images that stay on the screen for X amount of seconds (the user can set the value of x), then it loads the next image. However, this user would like for there to be a transition, For Example, have it fade out and have the next image in line fade in after the image has been displayed on the screen for X amount of seconds. This user would also like a loading bar, much like the one on the flash banner here: [URL] between each image transition.
I also have it so when someone hovers over a button, the flash banner stops, once they rollout X is reset to 1 and starts the counter again, and sets the movie to play at frame 1. Here is the actionscript file: [URL]
I want to dynamically load a series of SWF's to play one after another without the user having to click any buttons. I've build a nice shiny preloader that will allow each movie to load up, but I can't seem to figure out how to make the next step. I've tried creating "placeholder" instances, and linking them but as I said, I just don't have enough AS experience to do it right. Most of the time when I'm working in Flash I'm under a time crunch and I do everything through animation.
View 3 RepliesI use the following to load a jpg:
this.createEmptyMovieClip("loader_mc", 1);
this.loader_mc.loadMovie("mypic.jpg");
I can only set its position:
[code]......
I have a mp3 that I'm loading dynamically like so:
amnesiaLoop = new Sound(loopMC);
amnesiaLoop.loadSound("http://www.amnesiasc.com/assets/club0.mp3", true);
amnesiaLoop.start(0, 999);
The loop loads just fine but it stops after playing once even though I tell it to loop 999 times?
I have started putting together a flash based website to present my works. I am dynamically loading thumbnails and the larger companions using an XML file. Everything seems to work fine on my comp but when I upload it to my host sever the larger images do not want to load and on occasion a page of thumbnails doesnt want to load. My address is [URL]. Also the code I am using only places one image atop another, so when I click on a thumbnail it will place the larger image on top of the last it does not take the previous one away. which can be a problem if one image is smaller than the last. or if I wanted to load movie clips.
Here is the AS of one page.
//XML Trails stuff
//var to hold Tween;
var fadeTweenPhotoP1:Tween
// Creating image txtfield
var imageTextPhotoP1:TextField = new TextField();
// Instance of loader class
var imageLoaderPhotoP1:Loader;
[Code] ....
Can fonts be dynamically loaded or do all of the fonts have to be compiled into a swf?
View 1 RepliesImagine a database with a table of some items. Each item has 5 images inside and some other fields. In flash I have a page that duplicates all the items and shows them by thumbnails and a view button for each item. The movieclip that does this is for convenience movieclipA. When I press on the view button of an instance of movieclipA a duplicated movieclip takes place that has all the values of the specific item except of the images.
This movieclip - movieclipB duplicates for each item. This works perfect. I also have another movieclip movieclipC The movieclipB is a slideshow and loads the 5 images for an item by a self generated xml file that a php functions produces, depending on the querystring that is the idstring in my actionscript. I mean that inside the movieclipB I do
Code:
my_xml.load("findphoto.php?id=" + idstring);
So far the movieclipB works very well standalone...and this means that if I assign the querystring value inside the movieclip (for example idstring=1 and then call the function as above, the slideshow works verywell. How to pass for each item a different idstring into movieclipB and where exactly to put the movieclipB so it can be duplicated with movieclipA and take the correct idstring to do its job. Everything I tried to pass the idstring failed.
In the flash page among other code that I don't believe it's important, I have the following actionscript in the action layer
Main page frame 1:
PHP Code:
total = showPost.total;
var id:Array = new Array();
var headline:Array = new Array();
var details:Array = new Array();
var thumbnail:Array = new Array();
showPost = new LoadVars();
[Code] .....
VisitorsDetailsClip_mc is the movieclipB I mentioned above. MovieclipA (the one with the thumbnail) and movieclipB are placed on the stage of the main flash page.
of a complex question to me, but it's coming from an absolute beginner and it might be considered a stupid one, that's why I posted here...I've kind of been dropped in the deep end with this task and I can't get it right... I have a company's organisational chart in flash where it loads in each person's name dynamically for their department and when you click on it it brings up their CV information such as name, qualifications etc. This is loaded into a dynamic text box. I can test it locally with an xml file and then switch back to the online version.The local version I check by switching to "strXMLpath = "organisation.xml";" where things are laid out as follows:
Code:
<organisation>
<bod>
[code].....
How to add a child to the stage dynamically? I can get a child to add to the stage but not using dynamic variables. Is it possible?
Example:
var firstRoundWinner:String = "Redsquare";
var mc:MovieClip = new firstRoundWinner();
// want it to say = new RedsquareaddChild(mc);
With Redsquare as one of my movieclips and the linkage is working. I can add it if I hard code it. But I want to load the variable dynamically through xml.
I am trying to load dynamic images in order without all of them attempting to load at once....I have an array of images that I loop through depending on the gallery that will load up....but when i loop through the images all of them try to load.What i need to happen is somewhere in the
View 4 RepliesI can't get to load a movieClip dynamically.I have this code:[code]Also, I exported the movieClip to ActionScript with the name of myButton..When I test the movie- there're no errors, but there's nothing on the stage.
View 3 RepliesI'm trying to load Text into my file, and i have it all set up i'm just not seeing anything loaded, i've been through tones of tutorials but i can't work out why my text isnt loading:
Script:
myData = new LoadVars();myData.onLoad = function() {myText = this.myVariable;};myData.load("myText.txt");
[code].....
Is it possible to dynamically load vector files, in this case .ai files in Actionscript 3? You can import them to the stage, but I want to do this dynamically, is there a way to do this?
View 2 RepliesSo i decided to implement some themes in my AIR app. I have converted my CSS files into SWF files, removed the Style linkage from my main file. Based on the user preferences stored in a file, I decide which theme to use. i.e; load the SWF file using StyleManager class.
I made my application window invisible, added a StyleEvent.COMPLETE event listener for the IEventDispatcher object returned by StyleManager.loadStyleDeclarations method. After the StyleEvent.COMPLETE occurs, I made my main window visible.
The problem i have now is, for a few seconds, i can see white canvases and all my components without any styles before using the style selected. I want to know if my approach is correct or do I need to make any changes to implement this properly?
I have 30 swf files in a directory in my project named swf1.swf through swf30.swf. I need to load 10 randomly selected swf's without repeating any into 10 placeholders named myclip0 to myclip9.
my problem is I can not access the placeholders dynamically.
Code:
// random numbers that dont repeat from 1-30
var numbers:Array = [];
var total:Number = 30;
[Code]....
is there any way I can dynamically load a mp3 and have a loading bar? or preloader?
View 6 RepliesI am having a lot of trouble to get a preloader working for this code.
Short Desc: i have a listbox which gets the data from XML page. once i click on any on of the lable in the listbox, a image loads in a movieclip.
I am trying to add a preloader to the moviclip. the code below is what iam using:
Code:
_root.procent = Math.round((_root.scrollpane_sp.getBytesLoaded()/_root.scrollpane_sp.getBytesTotal())*100);
[Code].....
I have built an mp3 player, and when I run it locally on tomcat it works fine. Basically it gets the name of an mp3 from a menu list and loads the mp3 into a sound object using a hardcoded path for the url i.e: "C:/Jakarta/jakarta-tomcat-4.x.x/........." When I try to do this on the server, it is able to populate menu list ok (makes a request to a servlet for an xml response the returns the labels and values for the song titles). The sound does not play though. It appears to be loading, but it does not play. I think that it has to do with the url that I am using. loading mp3 dynamically on tomcat?
View 5 RepliesI would like to load text dynamically form my server into my flash movie. That I know how to do. I have 2 frames on 1 layer.
[Code].....
But when I try the same thing within a movie clip, I have trouble getting the text to display. The text box pops up but no text from my content.txt file.
I created a flash web site where I'm dynamically loading all the .swf files into one. I'm using Flash 8, Actionscript 2, Flash Player 8. The goal was to break up the file size of the project and load the .swf files via four buttons 'HOME' 'PEOPLE' 'RESEARCH' 'PUBLICATIONS' repectively. I was able to do this using the following code for the buttons.
button_name.onRelease = function () {
createEmptyMovieClip("container", 1);
loadMovie("people.swf", "container");
[Code].....