ActionScript 1/2 :: Access A Component Code Flash CS3?
Jul 21, 2008Can anyone explain me how you access a component code in flash CS3?
View 1 RepliesCan anyone explain me how you access a component code in flash CS3?
View 1 Replieshow to access the stage from within component code. (I am very new to ActionScript)
Here is the cut down code of the main application entry point:
Code:
package {
import flash.display.Sprite;
public class Main extends Sprite {
[Code]...
I need to access the main stage to add a mouse up event listener.
As stupid as my question might sound, i have spent the last 2 weeks reading oop books; but could use some guidance. I have a flash project that is basically a supped up slide show. On the stage i have the following: main_mc (instance name = images_mc) = movieclip which holds "pictures" ui1 (instance name = ui1_mc) = user interface that allows user to draw on picture (when drawing is enabled) ui2 (instance name = ui2_mc) = activates invisible hit areas (buttons) on select pics, when hit area is clicked, we jump to another pic in the main_mc.
I accomplished all of this on the timeline, but am updating the code to OOP. I am having A HELL OF A TIME trying to figure out how to store references to the instances (images_mc etc..), so i can control them from varying class files. I have found it is easy to control the instances from the documentclass, but not from unrelated class files. Example: images_mc.stop(); works in document class; but ovieclip(Parent).images_mc.stop() doesn't seem to work from any class file.(ui2 class file for example);
[Code]...
I have a confusion about components that How we can see and update code of a flash component. Some component are the movie clip symbols but other are compiled symbol. I need to check code of compiled movie clip(flash component).
View 1 RepliesI have two components. One is called "InsideComp" and one is called "OutsideComp". OutsideComp has InsideComp as one piece of its component, and in my main MXML file, I have embedded an instance of OutsideComp. How do I access a public variable of InsideComp within my main MXML file?In Actionscript, I could just do something like:OutsideComp.InsideComp.valToChange = 5; But I dont know how to do it in MXML. I know this is probably an easy question.
View 4 RepliesI would like to bind two components with out binding and which resides in different MXML.for eg: A.mxml has textinput and B.mxml has a combobox when choose one item in B.mxml selected item should be display in A.mxml textinput.
View 2 RepliesDoes Adobe had releases the source code for the components that comes with Flash CS4 (fl.controls.*). If not, is there any way to use the Flash component library with another IDE like FlashDevelop for code and compile the flash applications.
View 1 RepliesI have a component with a public variable declared
[Bindable]
public var mnuSource:String;
When I extend this component, I can reference mnuSource (it compiles) but Runtime complains about the property not being accessible (error 1056).
How do you modify / declare component properties so they are actually available to other components?
The following ActionScript 1.0 code no longer works in CS5:
productList.setChangeHandler("listchange");
listchange=function(me) {
gotoAndStop(me.getSelectedItem().data);[code]....
This code takes the value in a clicked cell within a List and positions the playhead on the frame indicated by the value. The label is a simple string and the value is the name of the named frame.I know that I need to use an event listener,
is there any way, to hide the source of a flash in the sourcecode, so that the movie itsself is not downloadable, or better not to copy?
View 1 Replieshave a movieclip on the stage, whose Class is "com.nestor.elements.letterKey". The class funcKey extends "key" which contains a "public var val:String". I have many instances of letterKey(asdfghj.... a full keyboard), so I'd like to use the IDE to arrange and pass variables. SO, within the Flash IDE/Library, I rightclick the symbol to access its component definition, and add a parameter for the var in the baseclass name:value,variable:var,default:whatever,type:Str ing).Now, in the constructor function for the baseclass, if I trace my variable: it is null.
View 1 Repliesi finished air application and it is need a local permission for the installed folder ( C:Program FilesAppName ) as i am generate xml ( desktopFileStream.writeUTFBytes(newXMLStr); ) from the application and its need local permission.first time i run the application i got ( error 3001 indicates a file or directory permissions issue ); when adjusted the permission for the current user ( manually ) to fullcontrol, its work great and perfect. how to give my application folder FullControl access by code ( AS3Flash )? as i can't ask each user to give my app folder manual permission.
View 5 RepliesI've been trying for hours to make sense of this problem. When I run my code through the Flash IDE, everthing is fine. However, when I run it through the command line compiler or Flex itself t doesn't work. This is after setting up all the required Flex bits to create a Flash stage and display content. it keeps giving me an "Access of undefined property" error though I've clearly defined those properties in question a line or two before.
[Code]...
What the heck is going on?? I'm stumped. Embed seems to work fine, but I'd prefer to change it this way. I think there's something about XML dynamism if you use embed instead.
I have two MC's on stage,
MCmenu is a button array,
MCtext is a collection of text with frame labels. It's labeled as MCtext
The menu buttons tell MCtext to play the frame label as the button clicked. This *used to work*, but Flash was laggy as hell so I updated it. Now the same code returns #1009: Cannot access a property or method of a null object reference. at MCmenu/itemClicked()
Code:
function itemClicked(butn:Event):void {
parent.MCtext.gotoAndPlay(SomeArray[butn.currentTarget.label);
}
I've tried just using a frame number, but still the same #1009
I've tried the Script Assist to target the MC on the stage:
using root.MCtext... still the same #1009
using this.MCtext... returns a #1010
In the main file, I would write[code]...
But if I want the component to have that behaviour innately, where do I write it in the mybutton mxml file to have it reference itself?[code]...
My big question is how to access the instance of the "SeekBarHandle" of the seekbar component which is created at runtime? I have a AS3 project (flashplayer 9) with a FLVPlayback component and custom FLV controls, partially build from standard FLV control components (play/pause component, stop component, seekbar component, volumecontrol component). The FLV control components are added at 'root' level of the project. What I'm trying to do is to switch the visiblity of the custom FLV controls where the seekbar and volumebar are the party poopers because of the on runtime created handle bars.
I read many many threads about people trying to access the instances of the handle bars but for the most of us out there with no luck. I know that the instance of the handle bar is created at the same level as the instance of the seekbar component but I can't trace/access/find the instance of the handle bar. NOTE: I don't want to add the seekbar component to a container mc/sprite because of the changing width of the seekbar. When I do it's disformed because by the scaling of the parent.
[Code]...
I have downloaded a component and one of their only methods is loadImage. I wanted to see if I could see if this function could also load an swf. Is it possible to see the code behind a component? I have tried editing class, but import fails.
View 5 RepliesI have a datgrid set up, I have some buttons that I made myself into symbols that adds new entries into the datagrid - this works fine also.But, I've since tried to replace my custom made buttons with those of the button component...So I have the following code on it:
on (click) {
UserGrid.addItem({name:"Name", quantity:"1", price:"10", totalPriceColumn:"10"});
}
Only difference is on my customer button I am using "on (release)". But I didn't seem to get that option in the button component? When I press the button, it does nothing?? My DataGrid is called UserGrid.
I need to know how I can access the images in this XML code (per image):
Code:
<?xml version='1.0' encoding='UTF-8'?>
<component name='XMLSlideShowV3'>[code].....
I just don't know how to access this type of xml code.And I can't change it to something else because I have a component that reads only this type of code.
I have the seek bar component on my stage and need to be able to use it to seek through the timeline just like any other video player. However, I am not using this to control a FLV movie, but just need it to control where I can seek through my animation.
View 4 RepliesIve just created my own custom scrubber using this tutorial, however, the code doesnt work with my flvplayback component.
View 4 RepliesI am putting together a presentation on flex for adobe user group that specialize in coldfusion. In my example I would like to display the text of the cfc being called from the webservice tag in my flex application. Is there a simple way to load the actual text for the cfc instead of the html that coldfusion is passing back to my URLloader variable?
[Code]...
do you know any browser-side component, in HTML/Javascript, Flash, Applet or Silverlight, that would allow source code edition with syntax highlighting and auto-completion.
CodeMirror has a good syntax highlighting support but does not seem to support auto-completion.If no such editor exists do you know any way to implement auto-completion using HTML and javascript or any other browser-side technology ?
I'm building a mobile AIR app using Flash Builder 4.5. The initial view in my views package is TestHomeView.mxml. I want to refer to it in one of my .as classes elsewhere in the app, and I'm not sure how to do that.
Theoretically I should be able to add an "id" attribute to TestHomeView.mxml, but FB gives me an error: "id is not allowed on the root tag of a component". The root tag is s:view.
The reason I need to do this is that within another class I make various calculations and then need to pass an array of values to a component in my view class. So in SomeOtherActionScriptClass.as I first assemble the array, myArray, and then in that class I want to do this:
myViewComponent.viewArray = myArray;
If I'm going to do that, I also need to import the view class into the .as class, which strikes me as weird. So is there a simple way to do what I want, or do I have to dispatch a custom event which contains the array, and listen for it in the view class?
EDIT - Based on the below MVC suggestion I did the following in model:
[Bindable]
public class Model
{
private static var myModel:Model;//doesn't let me name it 'model' because
[code].....
But it is coming back null. It isn't null when I put a breakpoint in the Model class, but when I try to access it from the view class, it's null. The model itself isn't null, but that variable is.
Is there a mechanism by which native code can be called from within ActionScript?
View 4 RepliesI have two flash files myVideo1.swf and myVideo2.swf Each one contents FLVPLAYBack component . myVideo1.swf FLVPLAYBack component instance name is "video1" myVideo2.swf FLVPLAYBack component instance name is "video2" I want to be able to access myVideo2.swf from myVideo1.swf using as3. I want when I click play button on myVideo2.swf the myVideo1.swf would stopped. Bother flash files are in the same folder.
View 2 RepliesI have two mxml files. one is main that is application tag mxml file and another is my mxml component file. I have a viewstack in my main mxml whose id is, say, "mainViewStack". Now I want to set selectedChild property of "mainViewStack" from my mxml component file. [code]...
View 4 RepliesI have two flash files myVideo1.swf and myVideo2.swf Each one contents FLVPLAYBack component . myVideo1.swf FLVPLAYBack component instance name is "video1" myVideo2.swf FLVPLAYBack component instance name is "video2" I want to be able to access myVideo2.swf from myVideo1.swf using as3. I want when I click play button on myVideo2.swf the myVideo1.swf would stopped. Bother flash files are in the same folder.
View 1 RepliesI work as a Flash Developer. There are lines of code I use maybe hundreds of times a day that I have to type out each time. Is there any way to save these custom lines of code to the ActionScript tools library?Or would there be a way to save a custom component that enters the lines of code automatically?
View 1 RepliesI already made some buttons that I was planning on using as a menu for difficulty, easy,medium, hard. The buttons are already made with all the states and graphics, so I wanted to add an event listener so that when you click a button for example easy, if the medium button was at its hit state I would revert it back to up, eg:easyButton.addEventListenere(MouseEvent.CLICK, function(e:event) { mediumButton.gotoAndStop("up") or mediumButton.up
but then I realized there is no propertie or function in the simpleButton class to change the state of the button, I know I can make a movieclip, and do gotoAndStop at the up frame, but is there a way to make it work as a button???