Dependency between plugins? Calling a method before plugin is created
I have 2 plugins, 1 of them is always there, the other not. During the
initialization of plugin 2, I try to access a settings variable from
plugin 1, but get an error because plugin 1 hasn't been created yet (load
order). i.e.:
;(function$) {
$.plugin2 = function(el, options) {
...
...
var init = function() {
plugin.settings = $.extend({}, defaults, options);
plugin.el = el;
var init = function() {
...plugin1Instance.settings.variable... <--------
}
init();
};
});
Would prefer not doing the timeOut method, was wondering what would be the
cleanest way of going about this.
Butchko
Sunday, 1 September 2013
Some assets from SWC are not imported in Flash Builder
Some assets from SWC are not imported in Flash Builder
For almost all of my projects I export visual assets from Flash Pro to SWC
to then import them in Flash Builder. Today I stumbled across a really
bothersome problem.
Some of my assets are not being imported. I've tried clearing my projects
multiple times, restarting my Flash Builder IDE, re-exporting my SWC.
Clearly there's a problem when importing it, because when I decompiled my
SWC/library.swf, I saw that all of my assets are exported just fine. When
I decompile my output SWF I see that instead of some assets there is a red
rectangle, and some of them are just invisible.
I don't know what to think and can't figure it out. The only thing that
might be a case is the file size of the SWC (approximately 2.5 MB), and
there are almost 160 linkages in there.
I wasn't able to find anything on the internet regarding the file size
limit or anything like that.
I'm using Flash Pro CC and Flash Builder 4.7 Standard on a Mac OS X 10.8.4
These are the red boxes I'm talking about:
For almost all of my projects I export visual assets from Flash Pro to SWC
to then import them in Flash Builder. Today I stumbled across a really
bothersome problem.
Some of my assets are not being imported. I've tried clearing my projects
multiple times, restarting my Flash Builder IDE, re-exporting my SWC.
Clearly there's a problem when importing it, because when I decompiled my
SWC/library.swf, I saw that all of my assets are exported just fine. When
I decompile my output SWF I see that instead of some assets there is a red
rectangle, and some of them are just invisible.
I don't know what to think and can't figure it out. The only thing that
might be a case is the file size of the SWC (approximately 2.5 MB), and
there are almost 160 linkages in there.
I wasn't able to find anything on the internet regarding the file size
limit or anything like that.
I'm using Flash Pro CC and Flash Builder 4.7 Standard on a Mac OS X 10.8.4
These are the red boxes I'm talking about:
Saturday, 31 August 2013
Assignment Operation Java
Assignment Operation Java
class string1
{
static public void main(String[] ar)
{
String s1 = "test";
String s2 = new String();
if(s2=null) //Line 0
{
System.out.println(s1);
System.out.println(s2.length()); //Line 1
}
}
}
What i expected to happen was
a) s2 will be set to null because its an assignment operation as I am not
using ==
b) And I will get a NPE at Line 1 during Runtime
and instead I got the following output as shown below.
Output is
if(s2=null)
^
required: boolean
found: String
1 error
Can someone explain why I am getting compile error ?
class string1
{
static public void main(String[] ar)
{
String s1 = "test";
String s2 = new String();
if(s2=null) //Line 0
{
System.out.println(s1);
System.out.println(s2.length()); //Line 1
}
}
}
What i expected to happen was
a) s2 will be set to null because its an assignment operation as I am not
using ==
b) And I will get a NPE at Line 1 during Runtime
and instead I got the following output as shown below.
Output is
if(s2=null)
^
required: boolean
found: String
1 error
Can someone explain why I am getting compile error ?
Where does 'flash' belong to?
Where does 'flash' belong to?
The forth line below sets flash, which is a FlashHash instance.
class LoginsController < ApplicationController
def destroy
session[:current_user_id] = nil
flash[:notice] = "You have successfully logged out."
redirect_to root_url
end
end
Where does this FlashHash instance belong to? If it's a global variable,
it should begin with $, and if it's a member variable of Application
Controller or its superclasses, the name should begin with @, correct? Is
it just a local variable that was created in "destroy" function?
The forth line below sets flash, which is a FlashHash instance.
class LoginsController < ApplicationController
def destroy
session[:current_user_id] = nil
flash[:notice] = "You have successfully logged out."
redirect_to root_url
end
end
Where does this FlashHash instance belong to? If it's a global variable,
it should begin with $, and if it's a member variable of Application
Controller or its superclasses, the name should begin with @, correct? Is
it just a local variable that was created in "destroy" function?
Cannot connect to SQL Server 2012
Cannot connect to SQL Server 2012
I'm trying to connect to a SQL Server 2012 database using C#, both the
server and program are on the same computer. When I try to connect I get
an exception:
A network-related or instance-specific error occurred while establishing a
connection to SQL Server. The server was not found or was not accessible.
Verify that the instance name is correct and that SQL Server is configured
to allow remote connections. (provider: SQL Network Interfaces, error: 25
- Connection string is not valid)
There is an inner exception simply saying {"The parameter is incorrect"}.
I'm trying to connect using this
SqlConnection sql = new
SqlConnection("Server=(local)\\MSSQLSERVER;Database=Test;User
ID=logger;Password=logger;Trusted_Connection=False");
sql.Open();
I have a SQL login called logger with the same text as the password and it
is mapped the database Test. I believe I have the server set up to take
remote logins.
Any ideas as to what I am missing?
I'm trying to connect to a SQL Server 2012 database using C#, both the
server and program are on the same computer. When I try to connect I get
an exception:
A network-related or instance-specific error occurred while establishing a
connection to SQL Server. The server was not found or was not accessible.
Verify that the instance name is correct and that SQL Server is configured
to allow remote connections. (provider: SQL Network Interfaces, error: 25
- Connection string is not valid)
There is an inner exception simply saying {"The parameter is incorrect"}.
I'm trying to connect using this
SqlConnection sql = new
SqlConnection("Server=(local)\\MSSQLSERVER;Database=Test;User
ID=logger;Password=logger;Trusted_Connection=False");
sql.Open();
I have a SQL login called logger with the same text as the password and it
is mapped the database Test. I believe I have the server set up to take
remote logins.
Any ideas as to what I am missing?
Create a New Image() in 1 Line
Create a New Image() in 1 Line
Right now, I'm using
var lifeIcon = new Image();
lifeIcon.src = "img/System/lifeIcon.png";
Is there a way to do the same thing in 1 line?
I tried
var lifeIcon = (new Image()).src = "img/System/lifeIcon.png";
But it doesn't work. lifeIcon is considered as a string...
Thanks.
Note: My goal is to use the Image in a canvas. Ex:
ctx.drawImage(lifeIcon,0,0)
Right now, I'm using
var lifeIcon = new Image();
lifeIcon.src = "img/System/lifeIcon.png";
Is there a way to do the same thing in 1 line?
I tried
var lifeIcon = (new Image()).src = "img/System/lifeIcon.png";
But it doesn't work. lifeIcon is considered as a string...
Thanks.
Note: My goal is to use the Image in a canvas. Ex:
ctx.drawImage(lifeIcon,0,0)
What does "(void)temp;" statement mean?
What does "(void)temp;" statement mean?
I was going through some code and came across a piece of code which was
like this:-
void func(int a)
{
int temp;
...
....
temp=a;
(void)temp;
}
What does the temp variable do here? If I compile it using -Wall option, I
do not get any compilation error or warning either. Please help me
understand this code style. Thanks.
I was going through some code and came across a piece of code which was
like this:-
void func(int a)
{
int temp;
...
....
temp=a;
(void)temp;
}
What does the temp variable do here? If I compile it using -Wall option, I
do not get any compilation error or warning either. Please help me
understand this code style. Thanks.
Subscribe to:
Comments (Atom)