ActionScript 2.0 :: Initializing A MovieClip?
Jan 30, 2005this is my code
stop()
container.loadMovie(_root.movie)
this.onEnterFrame=function(){
[code].....
this is my code
stop()
container.loadMovie(_root.movie)
this.onEnterFrame=function(){
[code].....
How do I write a combination of XML declarations and Actionscript classes such that I can initialize each of my three lists from XML?
note that I am not trying to populate a Flex UI element (such as a DataGrid) with the various number-name pairs. I'm just trying to read the data into a plain old vanilla collection. (Once I've got my collections initialized, I can populate DataGrids or whatever at my leisure.) I can't find any documentation of how to address this super-simple case. The documentation all assumes that I'm trying to do something much more complicated, such as accessing a remote database, which confuses the issue tremendously.
I have a FLA named Window.fla containing a movieclip that contains several other MCs, one of which has the instance name btnContact. This 'parent' MC is in the Library: it's called MainNav and its linkage is set to export, with its class pointed at com.utils.MainNav, the code for which is:
package com.utils {
import flash.display.MovieClip;
import flash.events.*;
[Code]....
How does one initialize a collection instance from MXML in Flex/Actionscript?[code]...
View 1 RepliesI am new to flash programming and am trying to create an empty 2D array.I have the Code:
ActionScript Code:
var squareList:Array = new Array(new Array());
Init();
[code]........
Im having trouble loading a clip through loadMovie and setting some properties of that newly loaded movie at the same time. For example I have an XML object loading data from a php page. The onLoad for that XML object loads a basic table movie, and tries to set the title and body fields of that movie. The problem is that I can load the movie, but I cannot set the properties of that movie until much later. Below are the examples of the failing code.I just cant figure out how to load data into a loaded movie. Ive even tried to include the table movie in the library of the main movie, so theres no loading latency. Even preloading the movie and jut duplicating that preloaded movie.
//frame actionscript
this.info.onLoad=function(success) {
if (success) {
[code]....
I've been working on a project for a little while now, and only yesterday did it start acting up. I added a bunch of new classes, and then two new functions and a few variables in the document class and then tested it only to find that it didn't work. I put a trace statement at the very beginning of the class: nothing. I commented out the two functions: nothing. I commented out the variables, and this time it worked. So I uncommented the functions: stopped working. I decided to check through the variables to see which ones would work, if any. One of them, a GTween instance, did work.
This is in a custom classpath: com.gskinner.motion.GTween. I tried other variables: only a few of my custom classes work (also in the same com folder, but a different path obviously), a few classes from the bit101 path work, but not all of them. The compiler doesn't throw any errors, and output doesn't show anything. It just comes up with my background and that's it. I neglected to mention that it wouldn't even work with some of the classes in the current directory. Some of them were fine. Now, however, it works with those classes that didn't before, but GTween is a problem instead.
I have a quick question for you all. I'm trying to convert over some ActionScript code to C++ and am having a difficult time with this one line:
private var edges:Vector.<Array> What is this exactly? Is this essentially a multidimensional vector then? Or is this simply declaring the vector as a container? I understand from researching that vectors, like C++ vectors, have to be declared with a type. However, in C++ I can't just put down Array, I have to use another vector (probably) so it looks like:
I don't expect you guys to know the C++ equivalent because I'm primarily posting this with AS tags, but if you could confirm my understand of the AS half, that would be great. I did some googling but didn't find any cases where someone used Array as it's type.
It seem to be buggy for 2 situations, I declare a timer for the socket
[Code]...
In certain situation, NativeProcess will hang itself too, this lead me to wonder if anyone encounter the same issse?
I've never extended a component class in AS2, and I'm having problems with it now.
Here's my class file:
Actionscript Code:
import mx.video.FLVPlayback;import mx.video.*;class AkamaiFLVPlayback extends FLVPlayback{
public function AkamaiFLVPlayback(){
super()}}
Here's how I'm trying to instantiate it from the FLA:
Actionscript Code:
import AkamaiFLVPlaybackvar g = new AkamaiFLVPlayback()this.attachMovie(g,myVid,1)g.contentPath = "[URL]"
Now this does not work at all. I can see that the super class FLVPlayback is creating variables, but it's not loading to the stage or initializing.
I get this error starting up Flash Professional CS5. I don't even have to create/open a Flash file. I already re-installed, but to no avail.
View 4 RepliesI am creating a flash object that does some heavy image lifting. What I am looking to do is load many flash objects onto the same page to take an image, modify it, and display it within the flash object.The problem I am running into is that when I try to add 100 flex objects to the page, the browser freezes as it tries to re-load/initialize each instance.Once they are all loaded, the processing of the images goes by quick.Does anyone know how to duplicate the flash piece without having to reload everything?
View 2 RepliesI have three lists and a button. Depending up on the selected items in first two list and after clicking the button I have to display the items in details list.
-In first list I am displaying names of employees
-In second list displaying managers names
-Then if I select one employee name and one managers name then after clicking button corresponding employee and managers details should be displayed in the third list.
The problem is with initializing the details list and dynamically changing it.
I have an applicon that needs to render about 100 flash graphs (as well as other DOM stuff) in a series of rows that vertically extend many times beyond the current visible window - in other words, the users have to scroll down see see all the different graphs.This application is also dynamic and when a user changes a value in the DOM (anywhere on the page) it will need to propagate that change to all the Flash graphs at the same time.So I setup all the externalInterface callbacks and was careful to not let any JS start going until the ever-so-important "flashIsReady" call and...it worked great until I tried to update() the existing swf's with new data.
Here was the behavior:- All the swfs load (initially) in both IE/Fox = good.- Updating swfs with new content works in Fox --ONLY IF-- I scrolled down to the bottom of the page, then back to the top -- BEFORE -- I triggered an update().So then I started tracing out each time a swf called the JS to say "flash is ready" and I realized, Firfox only renders swfs as they become visible. And To be honest - that's fine and actually, I am pretty sure that IE does this too. But the problem is that not only does Firefox not initialize the swf, Firefox doesn't even acknowledge the swf exists (expect for after onload) if it has not yet been visible.
In a current Flex project, i have an issue where a certain child component must be initialized and ready when the user clicks a button. the button is a mouseClick Event.
//mouseClick Event
protected function tableSearch_searchClickHandler(event:MouseEvent):void
{
[code]......
AS3
Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
Is there a way to temporarily suppress this on a specific block of code? I am creating a HUGE dynamic 3d array of objects, 1000x1000x1000 and need the build to actually finish the initializing.
i got a .fla file about 2xx mb (contain number of actionscript and layers) on another using Flash CS3 Professional and i use it ( Flash CS3 Professional) too ,
i can open the fla successfully , but when i try to export the fla to the swf
it appear the message : "Error initializing Java Runtime Environment , You may need to reinstall Flash."
result : the swf is gen but the frames move "non-stop" automatically
i had tried use different OS (winXP , Win7 ) and JRE
[Code]...
I'm currently on a Windows 7 64bits system and I've got this unsolved problem of "Error initializing Java Runtime Environment. You may need to reinstall Flash" pop-up at Flash CS5 launch. This error (apparently relied to AS3 compiling machine) also appears during SWF compilation (so the compilation is bugged and the SWF is unusable) I've googled it and tried every piece of answer but none of them worked :
- Re-install Flash or Java (32 & 64 bits)
- Delete CLASSPATH in environment variables
- Reduce (or raise ?!) -Xmx128M environment variable
- Launch application with XP SP3 compatibility
Is anyone here had the same problem and succeed to pass through in any kind of way
When I apply a 3D tween I get the following error when I test the movie: Error initializing Java Runtime Environment. You may need to re-install Flash If I remove the tween, no error on testing. Is this a bug? I am using CS4 on a brand new Dell M6300 mobile workstation.
View 1 RepliesI have some code that initializes an array (arrQAnswer) that stores what button the user clicked on (0,1,2, or 3). That option it put into arrQAnswer, then compared against arrCorrectAnswer to see if the user got the question right. The problem is that for each time the user clicks on a button, they are taken to a new screen to display feedback based on the answer of the question. If the user gets the question wrong they are returned to the original screen and try again. This is where arrQAnswer is screwing up (or more likely, where I am screwing up). On the first question where the user chooses an answer, then returns to that screen, arrQAnswer re-intializes. Is there a way to stop this from happening? Note that it only happens on the first question, I think that is because the first question is on the same frame as the code (below):
[Code]...
I have a class within a package, within which I am declaring and initializing a static variable:
Code:
package {
import flash.geom.Point;
import flash.display.MovieClip;
[code]...
However, I am hit with an error when I attempt to do this: Access of undefined property BALL_DIAMETER in package.If I merely remove the = 15 portion, this error goes away.This seems odd. Should you not be able to initialize a static variable in this way?
I have three dynamically created MCs on stage and when I press on first one I want to initialize ENTER_FRAME function , but Im getting this error:
[Code]...
We just bought 5 CS5 licences. Installed them all to our designers machines. All of them crash on startup..on "initializing tools".Have tried under a different profile. No luck. These are all XP machines.....all fully updated, both Windows and CS5.However, one copy does work on a Windows 7 machine.
View 6 RepliesSo, I have this main class:
Code:
public class Chloe extends MovieClip {
public var key:Controls = new Controls();
public static var box:Sprite = new Sprite();
G.boxRef = box;
public static var cow:Cow=new Cow();and in the Cow class i have this:
[Code]...
and it throws me TypeError: Error #1009: Cannot access a property or method of a null object reference.
if I try to trace(G.boxRef) in Cow constructor - it traces undefined in the first frame, but next frames are fine. But why? Both variable "box", and reference to it are declared before declaring variable "cow"?
I've written a simple MovieClip replacement that converts an existing imported MovieClip to a sequence of BitmapData. This removes the requirement for Flash to render vector data in the MovieClip on each frame.
But BitmapData has a huge memory footprint. I've tried converting the BitmapData to a ByteArray and using the compress() method. This results in a significantly smaller memory footprint. But it has proven impractical. For each redraw, I tried uncompressing()'ing the ByteArray, then using SetPixels to blit the data to the screen, then re-compressing() the frame. This works but is terribly slow.
So I was wondering if anybody else has an approach I could try. In Flash, is it possible to compress bitmap data in memory and quickly blit it to the screen?
I wonder how native animated GIFs work in Flash. Does it uncompress them to BitmapData behind the scenes, or is frame decompression done on the fly?
what I'm trying to do is accessingsnapText = scrollPane.source.textSnapshot;from an external swf. I've tried:
trace("-->: "+scrollPane.source.textSnapshot.getText(0, 1000));
trace("-->: "+myLoader.content.textSnapshot.getText(0, 1000));
trace("-->: "+mc.textSnapshot.getText(0, 1000));
[code].....
I have a horizontal scrolling movieclip that scrolls when the mouse is left or right of a certain point of that movieclip. However, it only moves slightly then stops when the cursor goes over it, it doesnt actually scroll normally...
[Code]...
I am trying to activate a rollOver-function when the mouse rolls over a movieclip inside of a movieclip.On the main window (root), first you rollOver a button where a window shows up with more options (movieclips).From stage, my first movieclip is called "catapultas_read_more" which leads to amother movieclip called "pic1_mc". The label that is going to play when mouse over on pic1_mc is "rollOn".I tried this.gotoAndPlay("rollOn); directly inserted to the movieclip, but the movieclip inside pic1_mc never starts
View 8 Repliesi'm trying to cast a MovieClip to a custom Class that extends MovieClip called MovieClipExt
ActionScript Code:
package {
import flash.display.MovieClip;
[Code]....
...but sadly returns null instead of a MovieClip converted to MovieClipExt
what should i change to make this work?
I have movieclip which contains child movieclip. when child movie clip finish to play i want to run a function in a parent movieclip. so I made a custom event dispatcher in the first frame of the child movieclip:
[Code]...