Flash :: IDE, Duplicated Objects Share Instances?
Jul 30, 2009
I'm using CS3+AS3 and I have a Flash project with a menu, the items in the menu can expand to reveal more items and this is currently done by having each state of the menu in a separate frame, and then doing "gotoAndStop" in this movieclip when buttons are pressed.Perhaps not the best solution, but works very well for this purpose, but as you can imagine, this means that the "same buttons" in "different frames" will do the same thing.All frames were constructed by duplicating the first frame, then moving the buttons around and adding more buttons where needed. So now I set instance names to the buttons in frame #1 and added event-listeners. But when I tested the project, the buttons that had event-listeners in frame #1 also had them in all the other frames. Now this could be an awesome feature, but right now it's more of a huge mystery to me.
ance names in frame #2, but yet they share the same instance. I searched all over the IDE but I could not find any functionality to actually determine what instances are linked, how to link instances or unlink instances. But I do know that two objects share instances when you duplicate them.So my question is, is there no functionality in the Flash IDE to actually make more efficient use of this?
View 1 Replies
Similar Posts:
Sep 23, 2010
I'm having problems with Shared Objects. They seem to work on my machine but when I put them on a server they're not working anymore.Basically I have a page with a video player and I only want the video to play when the user visits the page for the first time.This is the code:
PHP Code:
var beenVisited:Boolean=false;var shared:SharedObject=SharedObject.getLocal("visited");if (shared.data.visits==undefined) shared.data.visits = 1; beenVisited=fa
[code]......
View 2 Replies
Feb 22, 2009
I have a button class and I made 3 instances of that button class as.. btn1, btn2 and btn3 Is it possible for the btns to share a global variable or something? For instance what I am trying to do. if btn1 is pressed it triggers a global variable "isClick = true" and if I click on a different button (btn2 or btn3) it checks to see if isClick is true then it calls a function A if not then calls different function B.
View 1 Replies
Jul 3, 2010
On stage I have 2 objects on stage that share the base-class of "ABaseClass". Each has a child object that shares the base-class of "AnotherBaseClass". They child objects do not share the same parent, and have unique Linkage identifiers of "Object2Design" and "Object1Design", so they should be able to share the same name on the display-list, right? But if these child objects share the same name I get the following error. How to allow child objects to share base-classes and names?
TypeError: Error #1034: Type Coercion failed: cannot convert Object2Design@256cfe81 to Object1Design.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at AnotherBaseClass()
at Object2()
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
Example: [URL]
View 1 Replies
May 8, 2006
I'm making (or rather trying to make) a collision detection demonstration for my Media Studies coursework using a game as an example. However, I use FOR and duplicateMovieClip to create both a) the enemies and b) the bullets. how to register collisions with these objects.
Also, if anyone has any tips for using an array instead of the endlessly repeated "else if (x<num) {" lines, that'd be great to know!
For some reason I can't upload the ZIP file with the Flash in it on this Mac, but I'll upload it back on my own PC soonish. I'm not letting all this stuff I've typed out go to waste!
View 1 Replies
Sep 22, 2009
I want to create a flash movie which firstly loads a selection of images/objects into a portion of the frame. After this is complete, the user can then drag these objects onto another area and the object will be created where the user has chosen. The user can then drag another instance of the ojects onto the area.
For example, there is a background of a lake in one area. A selection of boat pngs are loaded in an area below the lake. The user can drag these boats and place them on the lake. They can drag a boat multiple times if they wish.
View 4 Replies
Jan 12, 2011
How to share TextArea Component in multiple swfsaylib.swf (has TextArea Componenet)main.swf (Import TextArea Componenet from lib.swf)section.swf (Import TextArea Componenet from lib.swf)
View 1 Replies
Nov 2, 2006
Lets say you have 5 instances of a circle on the stage.Now, lets say you want to make all of the circles _x += 5;How can I do this without doing a repeat loop?Isnt there a single line command that could be used? Such as: {tell all circle objects} : _x += 5;
View 4 Replies
May 26, 2010
Is it possible to store instances of a class in a cookie or in shared objects.
Basically in my application I have an object "Diagram" that the user can create. If they hit save, I want to store the current instance as a cookie and allows them to reload it later.
Alternatively, I could see about getting them to store the saved version on the hard disk. But even then, all I want to save and retreive is my actionscript object.
I've tried storing the object to SharedObject.data.diag, but when I try to retrieve the object from the cookie doing SharedObject.data.diag as Diag returns null.
View 1 Replies
Mar 7, 2011
Im creating a game. When the current game has finished, I thinking to do this:
removeChild(game)
game = null
then
game = new Game()
Doing this way, it automatically removes the games object instances? It automatically removes the games object instances events? That would be an easy way to restart the game, if yes for both questions.
Can I do like that, or I have to remove all objects and events manually?
View 4 Replies
Sep 14, 2010
I'm trying to sort MCs on stage that belong to different instances of different objects.
[Code]...
is there a simple way to use the Depth Management methods to control their sorting order? Right now, all I know how to do is place objectTypeB either in front of or behind all members of objectTypeA.
View 3 Replies
Dec 31, 2011
I know it is possible to make instances/children interact with other objects by adding an eventListener to each child/instance.But how do you make a random instance/child interact with another random instance/child?Example: let a bunch of spaceships get damaged by a bulletrain by using addChild to place both spaceships and bullets on the stage.
View 2 Replies
Mar 24, 2010
creating an AS3 Facebook share button? I need to be able to customize the title, description and picture.
View 3 Replies
May 22, 2009
I have an AS2 swf that has an array that is updated when a user clicks on items on the screen. The array stores the currently selected items. This As2 swf is hosted by an AS3 swf loaded in using Loader class and a local connection between them is managed by swfBridge. I want to know what the best way for both AS3 and AS2 swfs to share this array is? or how can I call a function in the AS2 (client) swf and return the array to the AS3 (host) swf when it needs to read the items from the array?
View 1 Replies
Jan 20, 2011
i have something like a flv player in my flash site and i load different flvs depending on user interaction. I want to add a "share on facebook" functionality so the videos will be shared on fb in a way similar to youtube sharing. I've serached a lot but there seems to be a lack of documentation on this subject.
View 0 Replies
Sep 22, 2004
alright.. recently i needed to share data between different flash .swfs on a homepage.. so i tried to use Shared Objects to do so. sofar its fine.. i tried it .. and as long as the data is stored on my harddisk. the sharedObject "cookies" work fine.. but when i put the site online.. they simply dont work anymore..
could this have something to do with security settings of the browser used?.. doesnt a web browser allow flash to access the harddisk to read and write shared objects.. is there another.. simpler and more reliable way to send data from one .swf file to another..?? (without using php -> my webserver doesnt support this sofar )
View 1 Replies
Jan 4, 2004
I'm making a little test game... In the game a rectangle moves from left to right and I want it so that if it hits the little circle you move around with the arrow keys that it will subtract from the lives variable I made. Then once the rectangle goes off the screen at the right I have it duplicate and start again with the previous rectangle at a random y position again on the left side...
The first "parent?" clips when they collide with the MC you control correctly subract from the lives variable but all the duplicated MC's do not work with the collision thingy. Any ideas on how I could go about setting it up so the parent MC and its duplicates all subtract from the lives variable when it collides with the user controlled MC?
View 1 Replies
Jun 11, 2011
Flex Mobile applications are view based. And I'm using Adobe Cirrus (im assuming its the same for any FMS netConnection) Does anyone know how to maintain a persistent netConnection between views in a flex Mobile Application?[code]I want to be able to trace(netConnection.nearID) on this view, go to another view and trace(netConnection.nearID) and get the same result. and be able to have a cirrusStatusHandler() function like I have a above to listen for cirrus events. Then be able to do netConnection.close() on another view if i wanted to to be able to close the connection.
Brainstorming Ideas what I was thinking I could do:I was thinking I could maybe set up the connection on the main ViewNavigatorApplication mxml file, but i have so much going on and being triggered based on netConnection status events it seems it might be really complicated to handle everything from that mxml file on each of the views. Maybe I could declare the netCon vars in the ViewNavigatorApplication mxml file, and just add event listeners to those vars on each view? But i'm not familiar with accessing vars that exist in the mainViewNavigatorApplication mxml file.I just need to be able to make the connection once, and then it stays persistent until I call netConnection.close()I guess I could use separate views where I dont need the netConnection and just have this particular view use "states" inside the view where the netCon needs to be persistent. It just seems silly be be using states since this is a view based application.[code]and the same in my Home View but i'm getting a null error when i try and call trace(netConnection.nearID) in the crationComplete function on profileView (which is after homeView) to see if it still has the same netConnection and should then be able to get the same nearID
View 4 Replies
Aug 8, 2011
How can I make a Flash Application that can be shared? Shared in the sense of like a paint box. If someone is painting there then the painting must be shown to all users. This means each user can write and edit in the paint box at the same time..
View 1 Replies
Aug 13, 2011
So i have a situation where i want to pass a object of a class say 'MyBigAwesomeClass' from a child to a parent. I import the class definition into both the parent and child. Now, if i load the child swf from a location that is relative to the location of the parent , all is fine, however the moment i load it using a full absolute path, it treats the definitions for 'BigAwesomeClass' in parent and in child as different and does not allow an object of the type 'BigAwesomeClass' to be assigned to an object of the same in the parent class.I am totally stumped, and have banged my head over ApplicationDomains, including using this code
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,swfLoaded);
var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
loader.load(new URLRequest(_file.url),context);
[code].....
View 4 Replies
Aug 3, 2009
how to open the Facebook Share page above my flash content inside of a div.
Here is the JS I would use to open it in a new window:
function facebook_share() {
u="http://thepageiwanttoshare.com";
t="pagetitle";
[Code].....
I then call this JS code from flash with ExternalInterface.
This code will basically open the facebook share page in a new window 626x436 with no toolbar etc.
This works perfectly, but I want to take this functionality and instead load that content into a specific div, which I guess I can then place above my Flash (using the z-index of the div and the wmode transparent param on the flash embed statement).
This doesn't seem like it would be too difficult, but I have never done something quite like this before. I heard that Adobe AIR actually has a Window class that can be used like an html window within flash, but unfortunately I am using AS3/Flex SDK.
View 0 Replies
Sep 16, 2010
Anyone have experience with this? I'm not much of a javascript person. This would be the code you could use on an html page.
I fugure you somehow have to have flash read the js file from fbook and then pass the share_url variable to it?
[Code]...
View 3 Replies
Aug 10, 2011
I need to add a facebook share button to a flash ad.
View 1 Replies
Jan 19, 2010
I'm currently doing a project that have a share button that linked to different social networking site.
I search the net, All i have to do is load
View 1 Replies
Dec 16, 2008
How do i create social sites (Myspace, facebook etc) share links in flash- so my site A should have an icon for another site B, when clicked one can go to the site B and share my site A there. is there any component in 2.0 to get it done.. or it simply be adding icons for these sites and using geturl .
View 1 Replies
Jan 4, 2010
I am trying to create a login system where a user would be able to login inside of one flash game on say, [URL], and then that same login data would be preserved for all the games on [URL] and also the games on [URL] and [URL] I am new to shared objects in flash so if anybody knows of a way to do this in either php, as3, html, js (or a mixture of all) then that would be great.
(PS. I would prefer not to use a method that requires a javascript bridge to retrieve cookies as this is impossible for games that are played on game-portal sites where only a swf file is used)
View 1 Replies
Mar 11, 2011
Is there any possibility to create a facebook share button in flash? need it in as2 . I need that button to share a link on facebook from a swf file.
View 4 Replies
Sep 22, 2004
recently i needed to share data between different flash .swfs on a homepage.. so i tried to use Shared Objects to do so..
sofar its fine.. i tried it .. and as long as the data is stored on my harddisk.. the sharedObject "cookies" work fine.. but when i put the site online.. they simply dont work anymore..
could this have something to do with security settings of the browser used?. doesnt a web browser allow flash to access the harddisk to read and write shared objects..
is there another.. simpler and more reliable way to send data from one .swf file to another..?? (without using php -> my webserver doesnt support this sofar )
View 1 Replies
Nov 10, 2011
how can we add in a Flash animation, two butons (Share and like vidéo) to Facebook
View 4 Replies
Feb 19, 2012
I work in a theatre and I'm looking to create a seat map that can be shown to members of the public as they book their seats, so they can see where they are going to be sitting. The main problem I've come up against is that the person viewing the application, will not be using it. I need the Box Office clerk to be able to input data, and then the seating plan shows the seats on a second monitor (public facing)
What I thought of doing was to create 2 flash applications and used Shared Objects to pass data from one to the other. In the Clerk application, they would input the seats that are being requested and click Submit (or whatever). In the Public application, these seats would then be highlighted. Ideally, another dynamic image would change to show the view from that general area of seating.
View 27 Replies