ActionScript 3.0 :: Skip The Creation Of A Data Object?

May 11, 2009

I'm in the early stages of writing a rather complex app that grabs data from a database (via PHP bridge) and builds out content from it.This app is going to be a very visual timeline of sorts, with different entries of many types (images, audio, video, text, etc). Each entry type has some common properties (ID, location, date, etc), and some unique (imageURL for images, audioURL for audio, etc).When creating these objects dynamically, should I:

A) First read the data from the database, assign that data to a new object that contains *just* the data, and then pass that data object to the constructor of the visual representation of that object when instantiating the specific object of that type? Or,

B) Skip the creation of a data object, and instead pass the data property by property to the specific object class.

For instance (very roughly),

A)Code:
// receive queries data here
var newImageData:ImageData = new ImageData(imageURL, headlineText, captionText); // put data into data object
var newImageEntry:ImageEntry = newImageEntry(newImageData); // create new visual object, passing data object

B)Code:
// received queried data here
var newImageEntry:ImageEntry = new ImageEntry(imageURL, headlineText, captionText); // create new visual object directly

I won't be creating the visual representation of the object immediately, so I feel like I have no choice but to map the data to a data object first....but is there another way? Should I try to merge the two, so that an ImageEntry object can be created as the data is received, but then a separate call to that object would be required to actually create the visual representation of it when needed?In the past -- which apps quite a bit simpler -- I've simply mapped all the data during the XML parsing to dynamic objects that act only as containers for the data, which is then passed to a different object to create the visual representation of it...

View 5 Replies


Similar Posts:


Actionscript 3 :: Object Creation In Flex By Declaring Type Object

Aug 6, 2011

We create Objects in flex by declaring type Object. for example

var objSampleObject:Object = new Object();

and we create properties directly with dot operator without creating any class

[Code].....

My question is in above process is there any class is created internally by flex?

View 2 Replies

ActionScript 3.0 :: Any Event After Object Creation?

Jun 10, 2010

I have a class which work with data and I want to do something after its constructorfunction is finished.If a class is a MovieClip, I can do this:

Code:
public function constructor() {
addEventListener(Event.ADDED_TO_STAGE,init);

[code].....

View 6 Replies

ActionScript 3.0 :: Object Creation Within Defined Area Only

Jun 9, 2010

I have a .fla set up right now that places ball randomly around the screen. However I would like to be able to set the coordinates of the range for the objects(particles) placement to the boundaries of a shape. I am starting with a circle for the moment, but I can't figure out how to set the range of object placement to that of an MC. I was planning on somehow calculating this out but I am stumped. Is there a better way for me to draw a shape, and somehow use a mask in as3 to define where the particles can no be placed?

View 21 Replies

ActionScript 2.0 :: Eval Methods - Dynamic Object Name Creation

Mar 9, 2009

I'm having problems with my usual eval methods of creating objects to read off dynamic values programmatically using concatenation. I've found the set command doesn't seem to work with objects that are dynamic....

Code:
function createobject(item){
//create it and store something in it
set ("_root.item"+item.stored, "data storage test for item "+item);
}function checkobjects(){
for (i=1;i<5;i++){
checkit=eval("_root.item"+i);
trace("_root.item"+i+".stored="+checkit);
[Code] .....

Running this produces the output of...
Code:
_root.item1.stored=undefined
_root.item2.stored=undefined
_root.item3.stored=undefined
_root.item4.stored=undefined

How to do this - basically I'm trying to load data, then use that to create dynamic objects and values within it, then I'm trying to work with those values by again using loops to read off the dynamic values during runtime. Obviously if these were "fixed" variables, then it would be easy, problem is that its impossible to use the new Object() command with dynamic names!

Previously I've used this:
Code:
checkit=eval("_root.item"+i+".stored);
trace("value is "+checkit);
Is it my imagination, or was this stuff a lot easier to do in AS1?

View 2 Replies

ActionScript 2.0 :: Dynamic Creation Of Movieclip Class, Not Object?

Feb 7, 2005

Is there another way to work with movieclip classes than attaching them from the library?For instance say that I have a textbox class that extends the movieclip class. Puts it on the scene and then I'm free to work with it from the class as I want.But inside this class I check if I need a scrollbar. If I do, then start a "sub-class" and create a scrollbar. I can have a movieclip in the library and attach it and have a new class on it. But what I want to do is write something like this

var clipScroll = createEmptyMovieClip("scrollBar", 3)
clipScroll = new com.texts.text_items.ScrollBar

the problem is if I do like this the class that I start is just an object. I can't trace where it is, I cant create a movieclip inside it and trace where that is.

View 6 Replies

ActionScript 3.0 :: Bitmap Creation After Display Object Internal Script?

Aug 11, 2009

I have an MC being duplicated to 2 bitmaps but they are created before the MC performs its internal script. How to change that order? See sample .fla.

View 2 Replies

ActionScript 1/2 :: Shared Object Skip Intro After First Visit?

Feb 13, 2012

Hopefully you guys can see something i am missing. I want to skip the intro of the flash movie after the first visit, so the user doesn't have to see the intro to get to the main site.
 
I have the code below on frame 1, an intro flv on frame 2 and the main site on frame 3. Code seems perfect and straight forward, why is it not working for me. I had a stop(); on frame 2 and 3 but I removed them to see if that would fix it, but no luck.

[Code]...

View 5 Replies

ActionScript 2.0 :: Shared Object Skip Intro After First Visit

Feb 13, 2012

I want to skip the intro of the flash movie after the first visit, so the user doesn't have to see the intro to get to the main site.

I have the code below on frame 1, an intro flv on frame 2 and the main site on frame 3. Code seems perfect and straight forward, why is it not working for me. I had a stop(); on frame 2 and 3 but I removed them to see if that would fix it, but no luck.

Code:
_so = SharedObject.getLocal("skipIntro");
_introcheck = 0;
if (_so.data.introcheck != _introcheck) {

[Code]....

View 1 Replies

Actionscript 2.0 :: Shared Object Skip Intro After First Visit?

Feb 13, 2012

I want to skip the intro of the flash movie after the first visit, so the user doesn't have to see the intro to get to the main site.

I have the code below on frame 1, an intro flv on frame 2 and the main site on frame 3. Code seems perfect and straight forward, why is it not working for me. I had a stop(); on frame 2 and 3 but I removed them to see

Code: Select all_so = SharedObject.getLocal("skipIntro");
_introcheck = 0;
if (_so.data.introcheck != _introcheck) {
_so.data.introcheck = 0;

[Code].....

View 1 Replies

ActionScript 3.0 :: Bitmap Creation "after" Display Object Internal?

Aug 11, 2009

I have an MC being duplicated to 2 bitmaps but they are created before the MC performs its internal script. How to change that order? see sample .fla

View 2 Replies

Data Integration :: Shared Object - Prompt Data Permissions Dialog?

Jan 19, 2007

I'm creating a small app to run from CD-Rom/local installation that will use multiple shared objects for data storage. To ensure proper saving without surprising the user with a permissions dialog unexpectedly, I'd like to request unlimited data storage on first time app launch - Joey Lott shows how to do this in the Actionscript Cookbook... request=mySO.flush(1024 * 500);

My question is,Can I perform this permissions request with the user a single time with a generic app SO in global fashion, so that the permissions would be set for any SOs created during the use of the product (all written to same SO directory),or do I have to request
permissions for each and every SO created? Since the latter would be unacceptable from a UE standpoint, that means stuffing all app data into a single SO which doesn't seem so great from a data config perspective...

View 1 Replies

ActionScript 3.0 :: Clear A XML Object Of Its Data To Allow It To Load New Data From The Same URL?

Sep 21, 2011

is there a way to clear an XML object of its data to allow it to load new data from the same URL?

View 1 Replies

ActionScript 3.0 :: Save Visual Object Data In Shared Object?

Jan 22, 2011

I'm using a loader for people to use to upload their own images for a background, and I want it to remember the image the next time they come to the page, so is there any way to save the loader data in a shared object? I haven't tried just using something like

Code:
sharedObject.data.dataName=loader

because I assume it doesn't work that way.

View 9 Replies

ActionScript 3.0 :: Mp3 Creation Using Bytearray?

Feb 2, 2010

I want to make a flash application in which i will load 3-4 different mp3 files of different instrumental music. After loading it I want play all files. Further I want to save or create a merged mp3, from all mp3s sound files in a single mp3 file.

Is it possible to convert different mp3 sound track in to different ByteArray and later using any other technology like PHP or C# can we merge all byteArray in a single byteArray to create a single mp3 file.
So that we can listen all instrument playing in a single mp3 file.

View 8 Replies

Message Board Creation Using Flash CS3

Aug 29, 2009

I am building an ambitious site especially for someone new to the Flash.I want to create a fully functional Flash Forum.Only problem is I have not found 1 site with information on how to build one and the only thing I did find was something called the Flash Forum Engine. It is a 3rd party software suite that allows you to build a Flash Forum BUT! it costs 1000 Euro's or $2000.

View 4 Replies

ActionScript 2.0 :: Flash 5 Scene Creation

Feb 21, 2010

I'm having a hard time creating a Flash using Flash 5. The first loop asks for a number of participants. The next loop, you select or enter the name of the beverages available. The third, and more complicated loop - Up to 4 randomly selected beverages are selected and a percentage (for mixing) are provided. For example;

[Code]...

View 2 Replies

ActionScript 3.0 :: Dynamic Swf Banner Creation

Jul 12, 2010

I have a project of dynamic banner creation. The main part of the job is creating a swf on clicking on a "publish" button on stage. A certain movieclip of any width and height on stage must be exported as a new swf file.

View 4 Replies

Simple SWF File Creation Tools?

Mar 7, 2012

I am considering using flash for a kiosk project together with Visual Basic. I need to create simple SWF file with some buttons and background image, and maybe play some movie clips. Could you kindly suggest free tools for that purpose.

If there are not free tools for that, what is the normal commercial enviroment use?

View 2 Replies

Movie Clip Creation And Placement?

Sep 12, 2009

When you make a movie clip, and have it open, does it have a physical 'place' on your pasteboard or main timeline?

For instance, when I test my 'scene' (as opposed to movie) my clip will be out of whack and off to the side of my movie viewer.

Then when I place the clip in my main timeline, i have to monkey around with it to get it to line up. I get a circle and a blue line at the top, but not sure what that space corresponds to.

Is there a good tut out there for movie clip creation and placement? It feels really sloppy the way Im doing it.

View 1 Replies

Professional :: Get Rasterized In The Swf Creation Process?

Feb 23, 2010

I'm somewhat of a noob here, so please forgive my ignorance.  I tried to google the answer to my questions, but probably not using the right terms.
 
So my questions are these: Is there any advantage to using vector elements in flash projects, or do they just get rasterized in the swf creation process?
 
If you use vector instead of raster art, can you scale your swf infinitely large (theoretically) without degradation? Will vector art result in a smaller swf size?  Will it take less processing power to play?

View 1 Replies

Professional :: Creation Of Guestbook In Flash?

Apr 29, 2010

I don't know whether its the right place to post this question, I am trying to create a guest book in Flash.

View 1 Replies

Java :: Web Services Creation And Consumption?

Dec 23, 2009

I'd like to learn how to create a java web service that can be consumed by a web tier, which is constituted of java and flex. What books can help me learn how to create a java web service and consume it via java & flex?Should I look to build a web service from scratch or from frameworks like: XFire, Axis, CXF, Spring Web Services, etc.?If using a framework is recommended, which of the above or any others makes the most sense to learn/use?

EDIT:Both the java AND flex components of the web tier need to independently access the web service. For example, the flex component helps the user create & save a spreadsheet; the java component retrieves the spreadsheet data and displays it accordingly.

View 4 Replies

Automating Creation Of Flash / AS3 Projects

Jul 11, 2011

My goal is to make a flash/as3 program that would pull multiple sets of data (images and texts) from the database and compile and save a flash video project for each one. What might be the best way to go about making this work? I checked but wasn't able to find a function that would publish the flash project in it's current state, so I don't think I can execute the entire process in a single flash/as3 file. My only other option is to have some other program/batch file take care of the querying the database and compiling multiple flash/as3 movies by starting up a flash program and passing it the parameters of the data it needs to build 1 complete project for 1 set of data. Is there a program to create .swf files automatically? Is it even possible to pass in init params to flash/as3 project?

View 1 Replies

Xml :: Adobe Flex XML Creation And Checking?

Aug 25, 2011

I am working on a game in flex, and I am trying to create an xml file for each user if it is their first use, and then after that just access that file and edit it accordingly.Is there anything that could do this same thing first off, basically create and edit some sort of save state? I assume that flex would have some kind of saving state type of thing, but I am not sure what to look for in that respect.If not, does anyone know how to do this with xml files?

View 1 Replies

Flex :: Panels Creation At Runtime Can't Seen Them?

Sep 27, 2011

My problem is i am trying to make a panel. My button in in Main.mxml whereas the panel functions are defined in panel_Create.mxml. the code works fine. In panel_Create their are functions to create panels at runtime. The problem i am facing is when i run the program it wont show the panels but it does increase the value of n and after 8 clicks it gives alert message. The code works fine when i put all the code in Main.mxml

<fx:Script>
<![CDATA[
import Components.panel_Create;[code].....

View 3 Replies

ActionScript 2.0 :: Code Creation For A Flv Player?

Apr 4, 2010

I have Flash 2004 MX (Educational Version), and I'm trying to get an flv player for my flv in my library to work with a play button (when the vid ends, it should automatically have the code written so that it will pop back to the start (if possible). I was coached a bit that I need to use the Netstream thing (as 2004 doesn't have the mediacomponent) and so far I've put the 'New Video' object onto my stage and created my own play button. (the video also shouldn't automatically play but should be sitting there 'ready to play' until someone clicks the play button.) Also, of importance, is that I have a timeline with a loop of animation that should be able to keep looping endlessly even though this video i'm wanting to stream is longer than the looped animation, so if someone plays the video, the animation loop should still keep animating/going even as the video is played or stopped, etc. In other words, the video should have it's own timeline apart from the animation's timeline. Unfortunately, I'm a newb with code and have no idea to get the video into the object or how to have the play button work with it, etc.

View 8 Replies

ActionScript 2.0 :: Button Creation And Labelling?

Mar 2, 2005

I have this code

Code:
_root.bottombar1.attachMovie("home_btn", "home1",1000);
_root.bottombar1.home1.dtxt.text = "Home";

[code]........

View 6 Replies

ActionScript 3.0 :: Custom Class Creation?

Jul 22, 2009

I'm making a custom class from a player I created from scratch.After multi verification of the instances , and after linking correctly my movie clip player, I still get the 1120 error.It doesn't get the "Player_mc." and all the mc inside it.1120:All of this is my first flash project.

Code:
package{
import flash.display.MovieClip;

[code].....

View 9 Replies

ActionScript 3.0 :: Delay Stage Creation?

Oct 28, 2009

I would like to set the stage size to the size of a random jpeg after it successfully loaded. So I don't know the dimenstions beforehand. It there a way to do that without using javascript. I know there is a solution using javascript, but I don't want to use that. I know I can set the stage size by using [SWF(width = 800, height = 600)]. But that only works before you do anything else. Not after loading the jpeg.

View 1 Replies







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