ActionScript 3.0 :: Porting Gallery Code From Flash To Separate Class

Mar 26, 2010

I have an xml gallery sort of that works fine when I have the code not as a class, in first frame in Flash. So I decided I wanted to port it into a class and the problem I get is at:
thumb = new Thumbnail(xmlList[i].image);
It expects 0 arguments. How come that line of code works in first frame in flash but not as a class? There is a movieclip in the library called thumb with linkage of Thumbnail.

Below if the code when used in first frame:
PHP Code:
var urlRequest:URLRequest = new URLRequest("pics.xml");
var urlLoader:URLLoader = new URLLoader();
var xml:XML;
var xmlList:XMLList;
urlLoader.load(urlRequest);
[Code] .....

View 4 Replies


Similar Posts:


ActionScript 2.0 :: Porting Fluid Layout Code?

Nov 23, 2010

I have been given a site to update/improve, which uses many AS1 and AS2 elements, and my team likes a piece of AS3 I've found for a fluid layout which tweens the site container to the centre of the browser's window, and we want to keep it.But at the moment, I have to load the AS1 site into an AS3 container in order to make this work, and this means we lose the deep linking, and it's really cumbersome loading 1 thing into another which is loaded into another...

Sooo, I was hoping someone knows how to translate this AS3 code into AS1/2. Is this possible? Does AS1/2 have the appropriate tween/ease classes? Here's what the container page looks (please ignore the commented out sections).siteLoader is the MC i'm loading the main site's SWF into. AS1 would also make this much simpler with loadMovie command.

ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;[code].......

View 3 Replies

ActionScript 3.0 :: Timeline Code And Separate AS File Code Working Together

Dec 27, 2010

Is there a way to make code on the timeline and code in a separate AS file communicate with each other?I have two buttons, a yes button and a no button.I have a confirm box which is a movie clip. In the movie clip I have the two buttons on it and code so that every time one of the buttons is clicked it runs a function.I have the rest of my code for the movie (so the code to make the confirm box appear) on a separate AS file.Is there a way I can define the functions on the movie clip and run the functions with the separate AS file?

View 7 Replies

Actionscript 3 :: Flash - Calling A Function From A Class Within A Separate Class?

Feb 4, 2012

I've been searching around trying to work this out for a while now. There's been various ideas popping up, like dispatchEvent etc but nothing that seems to be a clear, simple way of doing this.What I'm trying to do is call a function from a class seperate (but in the same folder as) my document class.Specifically, I want to 'spawn' an object and run a function within that object's class from my Main.as.The snippet I have at the moment is as follows;

In Main.as:
var object:class_Object = new class_Object();
object.spawn();

[code].....

View 2 Replies

Flash :: Interact With All Instances Of A Class From A Separate Class?

Jul 25, 2011

I've been hitting dead ends while programming lately all over, and I finally came to the realization all the code I have that is broken is because I don't know how to interact with instances of one class from within another. Here's the gist of what I am trying to do:

if(this.hitTestObject(targetClip)){
trace("hit!");
}

The problem is, if I address a single instance that is on the canvas, I get "access to undefined property targetClip", even though the document class can interact with it fine. If I target the class file of targetClip, I get "Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObject". It isn't just a problem with hitTest either, I'm having this problem with other actions, so there is some basic syntax I'm failing to comprehend.

View 2 Replies

ActionScript 3.0 :: Adding Flash Video Gallery To A Separate Flash File?

Jan 3, 2011

I am new to as3 and am having an issue transferring a Flash Video Gallery into a seperate flash file.Basically I want to add this video player file into a separate flash site I am making but don't know how with as3.I copy all the library assets from the video gallery FLA into the other movie, put the movieclips in the right location and upload all the relevant actionscript files, xml data linked with the original video player file but nothing still shows up when tested live.

View 0 Replies

Flash :: Create A Separate Class Then Create An Object Of That Class Within The Main Class?

May 17, 2011

I'm new to Flash AS3. I started making a game and I am a bit confused. Let's assume that I want to create a game that has multiple levels/modes, how can I do this in an object orientated way?

When i create games in other languages e.g. XNA C#, i create a separate class then create an object of that class within the main class and run the game based on a simple statement.

[Code]...

View 2 Replies

Flash :: Separate Class Definition And Declaration In AS3?

Sep 19, 2011

I am new to AS3 and I want to organize my code as what I did in C++, which I can have a .h and .cpp file. Is there any way to organize code like this in AS3? [code]....

View 2 Replies

Flash :: Relationship Of Code On First Frame Of Main Time Line To Class Code And Library Objects?

Mar 27, 2011

Got to the point where the hole in my AS3 knowledge is getting large!Realising I have confusion about the relationship of:Body of code on first frame of AS3 file.(Which I have so far used to create instances of library objects using addchild and make calls to class code).Is this code called the document code? What do people call it?Numerous classes linked together by extending each other etc.Library objects (usually graphical objects)Should it be done differently? have the following problems due to lack of understanding:Addchild complicated from a class but straight forward in main body code.Cant call functions on the main body code from classes, because class code does not know the main body code exists?

View 1 Replies

Flash :: Porting SWFs To Android Devices?

Jun 24, 2011

we have a number of SWFs we want to repurpose as Android apps, but are having trouble finding some information.

I realise that Android is spread across a lot of different Hardware but are there any standardised resolutions? If not how would you go about resizing the Stage depending on the screen?

Secondly can SWFs be uploaded to the Android store and if not what is the best way to mantain the SWF functionality whilst converting it to a format that can?

View 1 Replies

ActionScript 3.0 :: Flash - Make A Separate Class For Each Soundclip

Nov 23, 2011

I am making a little story thing which is sort of like a slideshow but I use sound in many parts of it. I searched online and the AS3 way of doing it seemed to be linking an imported sound clip to a class. My question is: Do I really have to make a separate class for each soundclip or is there an easier way of doing this if I plan to use these sounds multiple times? For reference, it should be roughly 434 sounds by the time I'm done

View 4 Replies

Javascript :: Porting An HTML5 Canvas WebGL Game To Flash

Sep 23, 2011

I had created an HTML5 Canvas WebGL game in January for the Mozilla Game On 2010 competition (pretty late, I know - I never released it until yesterday). Now I want to port it to Flash ActionScript 3.0 for a college assignment.I'm well versed with both static languages like C/C++ and Java; and dynamic languages like Python and JavaScript. However I don't know ActionScript, but since it's a subset of ECMAScript it should be pretty easy to understand.I want to learn programming in ActionScript 3.0 so that I may be able to port my game in Flash. To be more specific, I want to know more about:How is ActionScript different from Browser and Server-Side JavaScript, and basics.OpenGL programming in ActionScript (including loading textures, shaders, etc).How to create a HUD in Flash using a 2D HTML5 Canvas like API (in my game I have 2 canvases, one for the 3D game and another overlaying it for the heads-up display).Support for vector and matrix calculations in ActionScript.How to load assets like audio and sprites in Flash.It would be even more helpful if you would check my source code in JavaScript and suggest the best possible way for me to tackle this problem.The code for the main game engine and the game itself may be found in my Github repository.

View 2 Replies

Load Image Gallery (separate Swf) On Top Of Darkened Webpage

Nov 11, 2009

I've seen this done on many sites (it even happens on here when attaching links), where the screen darkens and an image gallery or form loads.
 
My question is, can this be done through Flash, but more importantly how to load a swf file this way. I noticed that the new Nike Running site has done it for their login functionality, where it loads the login box on a darkend screen, not sure whether the actual login is Flash but it's opened from within Flash.
 
[URL]

View 1 Replies

ActionScript 3.0 :: Separate The Code Into Classes?

Dec 8, 2010

Im currently trying to make an as3 fantasy football application for my uni course, but am finding it hard to seperate the code I have written into classes (which I have no been told is the only accepted method for the marking scheme). So far I have an external XML file containing player names load into a datagrid component, there is then an event listener on the table which loads the player images into their correct positions on a pitch when clicked. I need to write more functionality for it including saving to XML and error handling but feel I need to sort out the classes situation before I continue and it is in for this week.

Code:
import fl.controls.dataGridClasses.DataGridColumn;
import fl.data.DataProvider;
import fl.controls.ScrollPolicy;[code]..............

View 0 Replies

ActionScript 3.0 :: Splitting The Code Into Separate Files?

Oct 22, 2010

I'm looking for some help with the following script:

Main Class:

Code:
package {
// Flash Classes
import flash.display.MovieClip;
import flash.events.Event;

[code]....

Now, I'd like to move the blue color coded script to the separate package. When I do that, I've got many reference errors. how the code should look like, when it's in separate package, with all the references to variables that work? And how to call this function from Main class?

View 1 Replies

ActionScript 2.0 :: Make Button That When I Click On It Open Gallery Popup In Separate?

Feb 3, 2009

The problem is that i want to make a button that when i click on it open the gallery AS popup in a separate hrtml page + all the configuration[code]...

View 0 Replies

ActionScript 3.0 :: Moving Part Of The Code To Separate Package?

Oct 22, 2010

Main Class:package {// Flash Classesimport flash.display.MovieClip;import flash.events.Event;import flash.display.StageAlign;import [code]........

Now, I'd like to move the script between --- Start --- and --- End --- comments, to the separate package. When I do that, I've got many reference errors. how the code should look like, when it's in separate package, with all the references to variables that work? And how to call this function from Main class?

View 5 Replies

Actionscript 3.0 :: Basics Of Papervision3d Tut Code As A Separate As File?

Feb 17, 2009

I've just been following the Basics of Papervision3D tut, which is very good by the way, the only one I've ever managed to get working.And I'd like to write the code as a separate as file, but I'm having a bit of trouble.In the class definition, what should it extend?[code]I tried everything I can think of and looked at other tuts to see what they've done but nothing works.

View 1 Replies

Actionscript 2.0 :: Code For Button On Separate Layer In Timeline?

May 18, 2011

I made a button a stage, and I want the button to take the user to a separate scene that I have named "Biography page" when it is clicked. The thing is, I want all my actions on one specific layer. So I made an instance name for my button, "aboutme". The thing is... I have no idea how to write the code.

[Code]....

View 3 Replies

ActionScript 3.0 :: Flash - Change Class Code Into "normal" Code

Jan 6, 2011

Here is code for drag. i want to change as3 class to normal code as3

View 6 Replies

ActionScript 3.0 :: SoundManager - Pausing Sound By Referencing Code In Separate File?

May 22, 2009

I wanted to have this Zombie Penguin enemy use a walk sound (it would be odd if he moved and was silent) but because it is initializing the whole world, simply coding the sound into his animation state won't work because it will play the sound for every existing Zombie Penguin in the world, not just the one on the screen.

Now I've tried to get around this problem by using a SoundManager class [URL] to load and play/pause the sound when necessary. I've got this working by placing a movieclip above the world and hittesting everything and when it finds a Zombie Penguin activates the SFX. If it finds the enemy and you leave the room or kill the enemy (basically any way it is removed from the screen) it will pause the sound (not stop) and then unpause if you go back/find another instance of that enemy.

The problem is, though, that if I STUN the enemy (not kill it) it plays it's dizzy animation (which consists of hit sitting down with stars spinning around it's head) the walking SFX continues to play as the enemy is still on the screen.Now in the Zombie Penguins .as file it has a boolean that for being stunned or not (bStunned), and a function (public function getZPStun():Boolean -- returns bStunned). this bStunned boolean is set to a default of false.I figure that I just have to reference that somewhere in the following code, but I'm not sure where. The Zombie Penguin's .as is ZPEnemy, so I'm calling it like so:

ZPEnemy.getInstance().getZPStun()

I've tried calling it as part of an if statement a in a number of placesin hopes that calling it will relate the current state of the bStunned boolean, but I can't seem to get it to work.

Code:

var bNotPenguin = true;
for(var i = 0; i<this.numChildren; i++) //** Sound Manager Coding (May 15)
{

[code]....

View 4 Replies

C# :: Porting Silverlight App To Flex?

Mar 30, 2011

Perhaps a dumb question, but if you write a relative simple 2D game in .NET (e.g. for Silverlight) C# and you want to port it to Flex - just because you know C# and don't want to bother with other language, are there any means to facilitate this porting process?

Let's suppose that we are using FRAME BASED development (as Flash is, opposed to TimeLine in Silverlight) using the CompositionTarget.Rendering event.

I pose this question because I would like to try to create a fully functional app in .NET and then port it to Flex.

View 2 Replies

Actionscript 3 :: Specifying A Transition In Separate Class?

Dec 11, 2010

i have a function that looks as following:

private function createContent(slideData:Object):void
{
if (slide){

[Code]....

Now when i remove or add a slide I would like it to appear with a transition, I would like to create a separate class to put the different transitions in using tweenlite. How would I approach this the best way? So to sum up, when I add or remove a child, the transitions class gets called, it returns a transition and the slide gets animated when its added or removed.

View 2 Replies

ActionScript 2.0 :: Separate Instance Of That Class?

Sep 2, 2010

Issue : Each swf which imports the same static class seem to have a seperate instance of that class.cenario: 2 seperate .swf's import the same static class. The Static class named Static has a setter function named test which has the default value of 'NO'. Swf A sets the value 'Yes' for the setter function and loads in swf B. Swf B then trace the value for the test method of the Static class but swf B traces the default value instead of the value set by swf a.

I would love to figure out a solution so I can keep using statics since I currently depend on them to do a wide variety of things in my current project.

[Code]...

View 0 Replies

Javascript :: Porting SHA512 Implemention ?

Aug 12, 2009

porting a SHA-512 implemention in Javascript to Actionscript.Since both Javascript and Actionscript share the same origin, I think porting it will be easy for people who are used to Actionscript.The code for sha512 in javascript can be found here: http:[url].......

View 2 Replies

LibFLAC Porting Using Adobe Alchemy?

May 16, 2011

I'm trying to port FLAC encoder using Adobe Alchemy for use in flash but can't figure out where the problem is. I'm using Alchemy for Cygwin on Windows. It is properly installed and configured. The following are the steps that I have followed in order to port FLAC encoder:

[Code]...

View 2 Replies

ActionScript 3.0 :: Code Vs Class Code / Stage Items Go?

Oct 22, 2011

I had a 2 frame setup with some actionscript for each frame. Tried to move it all into one class file and a

1. frame .fla. ; Hiding and showing the resp. moviclips when i virtually move from frame 1 to frame

2. Now I get these ...Error #1069: Property edit_panel_mc not found on flash.display and there is no default value. errors or..

when i thought beeing clever adding the stage. prefix ReferenceError: Error #1069: Property edit_panel_mc not found on flash.display.Stage and there is no default value. The mc's are on the stage... i have a single .as classfile. Why cant I reference them? or how should i do it/ what should i do to change it from beeing .fla script to class script.

View 9 Replies

Actionscript 3.0 :: Code A Class Instead Of Putting Code In The Stage?

Oct 1, 2009

I see a lot of tutorials about coding actionscript 3 when they use all the code in a Class.I keep thinking every time why they use it in a class, instead of using actionscript on the stage.why it is more functional to code a class instead of putting code in the stage actionscript?

View 3 Replies

ActionScript 3.0 :: Controlling Sound From A Separate Class

Apr 7, 2009

Is it possible to start and stop a sound file from a separate class? In the first class, "House", I have called the MP3 using the following:

[Code]....

View 1 Replies

ActionScript 3.0 :: Access A Function In A Separate Class?

Sep 30, 2010

When I try and access a function in a separate class, I suddenly lose access to all root access in that class.Heres some code.EnemyBase

ActionScript Code:
package
{

[code]....

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved