ActionScript 2.0 :: [FMX04] Reusable Preloader From Tutorial?
May 2, 2005
I've been using the "Reusable Preloader Using MovieClipLoader" from the tutorial section of this site.The only difference is that i don't use 'm for preloading jpg. I load external swf files containing video. Everything works fine so far. The only problem is that the preloaded video already starts playing while preloading (at about 30%), but without showing the video.This is the code i have so far:
I was working with the XML Photo Gallery Thumbnail Tutorial on this site: [URL] And I modified it for my own usage, making it a vertical gallery instead, and had no problems until I came upon the thumbnail images. When I replaced the original thumbs with my new thumbs (that I sized based on width, as it is a vertical gallery) it got all screwed up. The images are of all different shapes. So when it loads up, some of them had huge gaps in between them, and others were even overlapping. So I fixed it by making the heights of all the images the same, resulting in a working thumb gallery, but now half my thumbs are cropped off by the mask. I'm looking for a way to fix it where I still have the same spacing between the images, and that they are all the same width, but can vary in their height. Here's the section of the code I am using:
I have followed the tutorial "Reusable Preloader Using MovieClipLoader" HTML Code: [URL] and found it extremely helpful, there is just one thing i would like to add to the code which i think should be easy, but i cannot work it out...
I would like to add a fade out as well as a fade in...
I have followed the tutorial "Reusable Preloader Using MovieClipLoader" [URL] and found it extremely helpful, there is just one thing i would like to add to the code which i think should be easy, but i cannot work it out...
I followed Lee's tutorial on the 3D rotating photo panels. Ive come to the point where I want to preload the con movieclip as the content inside is around 1mb. Ive tried several techniques but had no success.One technique was a preloader that goes to the next frame once the loading is complete. But I get an error that it cant reference the con movieclip.
I got some issues trying to watch Lee's Advanced Flash preloader tutorial. The video stops in the begining, cant download full file too. Stops when he begins to explain about the bandwidth.
I sent an email to pom regarding a tutorial that he wrote, but the email was bounced and he hasn't replied to my PM. I have followed both of pom's tutorials that involve experiments with perspective in Flash, but I have encountered a problem while attempting to duplicate a movie clip symbol in the second tutorial ([URL]). I have a single instance of the "ball" movie clip symbol appearing at random positions. However, I cannot seem to successfully duplicate the symbol instance at random positions using the loop that pom provided:
I have built a catalog in flash that was orginally built in InDesign and exported but it has some small content that is hard to read for the elderly users viewing it and I would like to add a zoom feature or some type of magnifying glass.
original: I really just need to figure out how to center the pictures. here is what I did I have modified the tutorial that I finished to have a bigger stage for bigger pictures. Everything is working properly but the pictures are displayed on the left side, I want to have them centered in the stage for the images, after clicking on the thumbnails, plus my images are different sizes as well. ranging from 200x410 to 744x410 but all are the same height of 410. i will post up what I am talking about at the end. I believe it is something within either the action script or the xml coding that allows the position of the image to be differently? please help here is what i am talking about[URL] Continued: Here is my coding in action script:
I am having a real problem with understanding something in flash - it doesn't work in the way I expect so I figure I have really misunderstood something.What I want:I am creating a bunch of .swf files and in each one I want multiple instances of an object that when you put the mouse over it the object will play its animation a bit and pop up a tool tip. Each object can look different (i.e. be a different bitmap) and animate differently (shake, pop, rotate etc).What I did:I have tried to create a class (myMouseItem) that creates the necessary listeners to handle the animation and pop up the tool tip.
I create a library item and attach it to the myMouseItem class. I can then put one instance of this inside my .fla and it works. (I still seem to have to put a .stop() in the actionscript for the scene to get it to stop animating for ever but I can probably live with that)What I can't figure out:How do I repeat this with multiple objects all with different bitmaps but reusing the underlying class? When I try to add another instance of my library class and edit the bmp it changes all instances. When I try to create another library item with the same underlying base class I get an error saying that I have to choose a unique identifier, so I don't seem to be able to reuse my .as file.
I am looking for reusable open source components. The level of depth, breadth and hopefully quality that I'm looking for is similar to this. Although I need them in programming languages C#, Java and Flex (which I often use in my projects), other languages such as PHP, Perl, Python, Ruby etc. are welcome. I see this as a big help for other programmers who have similar needs such as mine.
I plan to eliminate code duplication when building a large scale (in terms of code size) project by using this components and focus more on the business logic of it. Is there an open source (Java) or Codeplex (Microsoft) component implementation that does this that I'm not aware of?The main point that I want to address for this question is to avoid interdeveloper duplication. Interesting case found in Pragmatic Programmer: An audit for government computer systems have been made showed 10,000 different programs having their own version for Social Security number validation.
I want to write a function for loading html text from a file, but I'm having trouble figuring out how to use LoadVars correctly in that manner. I'm not loading speific variables, but a chunk of html.'d like to be able to do something like this:
A good button should have all the available out, over and down states, and often there are a bunch of nice to haves such as animation, disabled states, filters, you name it. I seem to change my mind in each project I do. The last one, I reskinned and extended the Button Component. The project before I extended SimpleButton Before that I built my own custom class using a Sprite and TweenLite. Then of course you need to work out if you will use library items which is great for laying out on stage, or do everything from scratch using code, which is more powerful but crap for design. I haven't looked at the swc or component route myself.
I'm trying to create a reusable button like it was possible in ActionScript 2 using the Var of a dynamic text box, hence allowing me to chose the name of the button and its link inside the HTML and pass these variables on to the swf file. This therefore means less traffic, and faster load times.
I'm trying to make the code below reusable. I need multiple toggle buttons in my flash project. Right now the code below works on one button. If I continue and create more buttons, and follow the format below, I would need to create separate functions for each button.
I would like to put the reusable code in a separate ActionScript file and not in the FLA file. I am trying to put the rolloverToggle, rolloverToggle, and toggleClick in a class that I'm making.[code]...
I need to create slideshow for gallery. And one thing that i don't know is how to create reusable components. For example i want to create 3 components ImageLoader, Dock(that consist drom ImageLoaders) and SlideShow(that consists from Dock and ImageLoaders).
ImageLoader it is a container which loads image and while it loading showing some animation Dock it is a container wich have few of ImageLoaders, it used to create Dock of thumbs images to chose.SlideShow it is a container wich have few of ImageLoaders, it used to preload images to ImageLoaders and the change them on mouse click.I need that all of this components was accessible fom action script, so i can create new instances of them.
Example code:
im1 = new ImageLoader('../im1s.jpg'); im2 = new ImageLoader('../im2s.jpg'); dock = new Dock(new Array(im1,im2)); ss = new SlideSHow(new Array(im1,im2),dock); ss.init();
The sequence basically involves rockets being fired when an appropriate timer event is triggered. Each instance of a rocket has a code which looks for a mouse click event, and then tells it's parent (I've called it "gameplayzone") to remove it from the scene.I've got a problem where:I'd also like to be able to update a score variable held in the gameplay zone (add 50 to it's current value for example)I also want it to modify a "lastcolour" variable in the parent, which is a string. The lastcolour variable is used to see if the play is clicking rockets of the same colour, which is used to calculate a combo points bonus.
The biggest issue however is that I'd like the gameplay container to simply be able to add a new instance of a rocket when I want to, but also define that specific instances values (x position, y position - but also xVel, yVel and yAcc which are properties inside the rocket class)This is a blunt question, but... What's the best way to do this?
how to breakdown a given functionality into resuable classes.The style of scripting is very messy and lots of repetitive codes, as most of the time I just jump straight into scripting without prior planning (bad habit).Now with this component as a base, I want to learn how to manage my codes in a cleaner, more efficient way, OOP style. (I only get to know about how good and time-efficient OOP style programming is after I 'discovered' the Tween class a month ago lolx)For a start I will need some planning.. that's the place where I'm now stuck in..I've come out with the core items which I think should be as classes
1) Controller
2) Drag clips
3) Hit boxes
How much further should I break them down? Read from tutorials that generally classes should only perform one task is that true? The controller deals with 2 tasks (handling events and 'calculation part'), should I break them into 2 separate classes?From tutorials I also get to know that we can assign a class to a symbol in the library. Is it possible for to attach classes at runtime to script generated or existing timeline instances? something like instanceName = new classFunction(parameters) ?
So Im developping a video player that I can reuse in my projects.
The video player contains both .as files and graphical assets (buttons, loading bar, etc). And the graphical assets need to be styled for each project.
Right now the approach Im thinking of is having a base videoplayer.fla, and importing the library items into my new fla, and modifying the graphical assets manually there.
The other option Im thinking of is compiling a swc, but afaik the styling would become more complicated and more limited to colors, fonts, and such.
I have been working on creating a package of reusable code for myself. I frequently create projects that have a set of panels, which I re-skin for each particular project, and each panel has its own body of functionality.There are about 10 different panels that could be used in a given project, but not each panel is used in every project. Some projects use 5, some use 8, some 10 etc. My problem is that when migrating the panels to a new project, I don't nessicarily want to have every single panel in the library with appropriate exports etc. if it's not going to be used in the project.
For example
PHP Code:
package panelPack {public class Main extends MovieClip{public function Main(){}public function activatePanel1():void{var panel1:Panel1 = new Panel1();}public function activatePanel2():void{var panel1:Panel1 = new Panel2();}public function acti
[code]...
Then I have something like a config class that would have code like this:
Then each class is something like this, referencing a library item that is exported:
PHP Code:
package panelPack {public class Panel1 extends Panel{public function Panel1(){var closeButton:SimpleButton = this.closeB;var submitButton:SiimpleButton = this.submitB;..........}}} I don't have to have panel1, panel2.....panel10 in the library if i'm only activating 1, 3, and 5!If i don't have those items in the library i get all kinds of undefined properties buttons etc. Everything that in the MC that gets exported.
Basically I'm using the code below to change the colour of the text in a movie clip that I'm using as a button. This works fine, but I have 8 buttons in my navigation and at the moment have to duplicate this code for each one. How to turn the colour change code into a function that I can reuse?
I've been using a fairly un-dynamic approach in AS3 as until now when it comes to loading assets, but now I'll be trying to adapting a current project to fit other clients with different needs which means I'll have to grab the bull by the horns. I have an XML with a list of images that will be used, which is reused multiple times in each project. So I'm wondering if there's a way to load an image using the loader-class, and making it reusable? Being able to attach said asset later to a placeholder inside a movieclip I have stored in the library would be ideal.
I managed to load it into a movieclip but duplicating it from there on was a bit of a headache, using an approach similar to this would be great(but I have personally no idea of how to implement it): [URL] Here's the current code I'm using, in case it helps understanding what I'm after(it's most likely really ugly compared to what you SHOULD be doing in as3):
I am trying to create a reusable class. documentation says to use as package name the directory structure.
in directory C:JJGFlashSourceRF i have a class in a package called "package C.JJG.FlashSource.RF {" in my test flash file I have "import C.JJG.FlashSource.RF;" I also tried import JJG.FlashSource.RF;
Does anyone have a loading solution that allows for loading swf's, jpegs and is fully customizable? My duct tape solution had been to have loaders in every swf that i was planning to load in- but this feels silly. I've tried a couple of components from the adobe exchange but they lacked a bit of elegance. Whether it's a class or example file- I just want to be able to smoothly load content into the parent- where the loader also resides.
I am new to flex framework.I have created an application using flex framework 4.1 which is having various components that are shown to the end user in the form of a popup window using <mx:TitleWindow>.This titlewindow is closed either on the click of the close button (displayed in it's titlebar) or by pressing the "escape key" on the keyboard.I coded a functionality wherein I close the current TitleWindow whenever an 'escape' button is pressed.Here is what I did.On the keydown event of TitleWindow I called this function.[code]I had to repeat this code for every TitleWindow that I have used in the project.How can I write the above functionality only once and reuse it amongst various TitleWindow and other components so that the code for the same is not repeated across various components? Every TitleWindow that I am using has different code, scripts and layout in it.
i'm calling a php file, which is supposed to make an xml file. whenever i call the php file using this syntax, most of the time i get "cannot load file" in the xml loading section, but this updates the xml file.
[code] loadVariables("http://localhost/file.php",this,"POST");[/AS] but when i do it this way. [code] loadVariables("http://localhost/file.php",NONE,"POST");[/AS]
the "cannot load file" messge doesn't get displayed, and the file loads perfectly, but this doesn't update the xml file.
so everytime i have to first use "this" and then "none".
what can i do so that whenever php is called, it'll update the xml file, and still load in the swf.
i'm calling a php file, which is supposed to make an xml file. whenever i call the php file using this syntax, most of the time i get "cannot load file" in the xml loading section, but this updates the xml file.[code] loadVariables("http://localhost/file.php",this,"POST");[/AS]but when i do it this way.[code]loadVariables("http://localhost/file.php",NONE,"POST");[/AS]the "cannot load file" messge doesn't get displayed, and the file loads perfectly, but this doesn't update the xml file.so everytime i have to first use "this" and then "none".what am i doing wrong? what can i do so that whenever php is called, it'll update the xml file, and still load in the swf.